Skip to content

Instantly share code, notes, and snippets.

@goyuninfo
Created September 25, 2020 16:54
Show Gist options
  • Save goyuninfo/edbc368ca7d8773e387383255f5a4b31 to your computer and use it in GitHub Desktop.
Save goyuninfo/edbc368ca7d8773e387383255f5a4b31 to your computer and use it in GitHub Desktop.
#---------------------------------------------------#
#-- Detect Ubuntu Version....
#---------------------------------------------------#
version=$(lsb_release -sd)
codename=$(lsb_release -sc)
echo
/bin/echo -e "\e[1;33m |-| Detecting Ubuntu version \e[0m"
if [[ "$version" = *"Ubuntu 16.04"* ]];
then
/bin/echo -e "\e[1;32m |-| Ubuntu Version : $version\e[0m"
echo
elif [[ "$version" = *"Ubuntu 18.04"* ]];
then
/bin/echo -e "\e[1;32m |-| Ubuntu Version : $version\e[0m"
echo
elif [[ "$version" = *"Ubuntu 20.04"* ]];
then
/bin/echo -e "\e[1;32m |-| Ubuntu Version : $version\e[0m"
echo
elif [[ "$version" = *"Ubuntu 19.10"* ]];
then
/bin/echo -e "\e[1;32m |-| Ubuntu Version : $version\e[0m"
echo
else
/bin/echo -e "\e[1;31m !--------------------------------------------------------------!\e[0m"
/bin/echo -e "\e[1;31m ! Your system is not running a version other than !\e[0m"
/bin/echo -e "\e[1;31m ! U16.04.x/18.04.x/19.10/20.04.x !\e[0m"
/bin/echo -e "\e[1;31m !--------------------------------------------------------------!\e[0m"
echo
exit
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment