Updated detect script
This commit is contained in:
@@ -10,7 +10,7 @@ resetDistVer() {
|
||||
|
||||
if [ -f /etc/centos-release ]; then
|
||||
. /etc/os-release
|
||||
if [ "$VERSION_ID" == "7" ]; then
|
||||
if [ "$VERSION_ID" = "7" ]; then
|
||||
DISTNAME=centos
|
||||
DISTVER=7
|
||||
else
|
||||
@@ -18,13 +18,13 @@ if [ -f /etc/centos-release ]; then
|
||||
fi
|
||||
elif [ -f /etc/fedora-release ]; then
|
||||
. /etc/os-release
|
||||
if [ "$VERSION_ID" == "30" ]; then
|
||||
if [ "$VERSION_ID" = "30" ]; then
|
||||
DISTNAME=fedora
|
||||
DISTVER=30
|
||||
elif [ "$VERSION_ID" == "29" ]; then
|
||||
elif [ "$VERSION_ID" = "29" ]; then
|
||||
DISTNAME=fedora
|
||||
DISTVER=29
|
||||
elif [ "$VERSION_ID" == "28" ]; then
|
||||
elif [ "$VERSION_ID" = "28" ]; then
|
||||
DISTNAME=fedora
|
||||
DISTVER=28
|
||||
else
|
||||
@@ -38,7 +38,7 @@ elif [ -f /etc/lsb-release ]; then
|
||||
DISTVER=${DISTRIB_RELEASE}
|
||||
if [ "$DISTNAME" != "ubuntu" ]; then
|
||||
if [ "$DISTNAME" = "linuxmint" ]; then
|
||||
if [ "$DISTVER" = "19" ] || [ "$DISTVER" = "19.1" ]; then
|
||||
if [ "$DISTVER" = "19" ] || [ "$DISTVER" = "19.1" ] || [ "$DISTVER" = "19.2" ]; then
|
||||
DISTNAME=ubuntu
|
||||
DISTVER=18.04
|
||||
else
|
||||
@@ -54,36 +54,38 @@ elif [ -f /etc/lsb-release ]; then
|
||||
else
|
||||
resetDistVer
|
||||
fi
|
||||
fi
|
||||
elif [ -f /etc/debian_version ]; then
|
||||
DISTNAME=debian
|
||||
DISTVER=$(head -1 /etc/debian_version|awk -F. '{print $1}')
|
||||
if [ "$DISTVER" != "9" ]; then
|
||||
if [ "$DISTVER" != "10" ]; then
|
||||
resetDistVer
|
||||
fi
|
||||
elif [ "$DISTVER" != "18.04" ] && [ "$DISTVER" != "18.10" ] && [ "$DISTVER" != "19.04" ] && [ "$DISTVER" != "19.10" ]; then
|
||||
resetDistVer
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$DISTNAME" == "unknown" ]; then
|
||||
if [ "$DISTNAME" = "unknown" ] && [ -f /etc/debian_version ]; then
|
||||
DISTNAME=debian
|
||||
DISTVER=$(head -1 /etc/debian_version|awk -F. '{print $1}')
|
||||
if [ "$DISTVER" != "9" ] && [ "$DISTVER" != "10" ]; then
|
||||
resetDistVer
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$DISTNAME" = "unknown" ]; then
|
||||
if [ -f /etc/os-release ]; then
|
||||
. /etc/os-release
|
||||
if [ "$ID" == "arch" ]; then
|
||||
if [ "$ID" = "arch" ]; then
|
||||
DISTNAME=arch
|
||||
elif [ "$ID" == "antergos" ] || [ "$ID" == "manjaro" ]; then
|
||||
elif [ "$ID" = "antergos" ] || [ "$ID" = "manjaro" ]; then
|
||||
DISTNAME=ubuntu
|
||||
DISTVER=18.10
|
||||
elif [ "$ID" == "opensuse-leap" ]; then
|
||||
if [ "$VERSION_ID" == "15.0" ]; then
|
||||
elif [ "$ID" = "opensuse-leap" ]; then
|
||||
if [ "$VERSION_ID" = "15.0" ]; then
|
||||
DISTNAME=opensuse
|
||||
DISTVER=15
|
||||
elif [ "$VERSION_ID" == "15.1" ]; then
|
||||
elif [ "$VERSION_ID" = "15.1" ]; then
|
||||
DISTNAME=opensuse
|
||||
DISTVER=15.1
|
||||
else
|
||||
resetDistVer
|
||||
fi
|
||||
elif [ "$ID" == "opensuse-tumbleweed" ]; then
|
||||
elif [ "$ID" = "opensuse-tumbleweed" ]; then
|
||||
DISTNAME=tumbleweed
|
||||
DISTVER=
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user