Created
May 5, 2024 16:04
-
-
Save Kwyrky/10e3d9de0a1e97c06ab8566142f6040f to your computer and use it in GitHub Desktop.
Show info about linux mint version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| # save this script to a file, e.g. "linux-mint-version.sh" | |
| # make it executable with "chmod +x linux-mint-version.sh" | |
| # run the script with "./linux-mint-version.sh" | |
| linux_mint_version=$(cat /etc/lsb-release | grep DESCRIPTION | awk -F= '{print $2}' | tr -d '"') | |
| codename=$(cat /etc/os-release | grep UBUNTU_CODENAME | awk -F= '{print toupper(substr($2,1,1)) substr($2,2)}') | |
| codename_lowercase=$(echo $codename | tr '[:upper:]' '[:lower:]') | |
| case $codename_lowercase in | |
| "focal") | |
| release="Ubuntu 20.04 LTS (Focal Fossa)" | |
| support="Long term support release (LTS), supported until April 2025" | |
| ;; | |
| "jammy") | |
| release="Ubuntu 22.04 LTS (Jammy Jellyfish)" | |
| support="Long term support release (LTS), supported until April 2027" | |
| ;; | |
| "noble") | |
| release="Ubuntu 24.04 LTS (Noble Numbat)" | |
| support="Long term support release (LTS), supported until April 2029" | |
| ;; | |
| *) | |
| release="Unknown Ubuntu release" | |
| support="Unknown support time" | |
| ;; | |
| esac | |
| echo "${linux_mint_version} [${release}] --> ${support}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment