use lsb_release to detect OS (#712)

This commit is contained in:
Kyle Brennan 2018-11-16 11:31:55 -08:00 committed by Daniel Hansson
parent b357b63afd
commit 8a94bb2cf0

8
lib.sh
View File

@ -394,7 +394,13 @@ fi
check_distro_version() {
# Check Ubuntu version
echo "Checking server OS and version..."
if uname -a | grep -ic "bionic" &> /dev/null
if lsb_release -c | grep -ic "bionic" &> /dev/null
then
OS=1
elif lsb_release -i | grep -ic "Ubuntu" &> /dev/null
then
OS=1
elif uname -a | grep -ic "bionic" &> /dev/null
then
OS=1
elif uname -v | grep -ic "Ubuntu" &> /dev/null