diff --git a/extras/vpnupgrade.sh b/extras/vpnupgrade.sh index 26e6bbc..dfc0c55 100644 --- a/extras/vpnupgrade.sh +++ b/extras/vpnupgrade.sh @@ -21,8 +21,11 @@ exiterr() { echo "Error: $1" >&2; exit 1; } exiterr2() { echo "Error: 'apt-get install' failed." >&2; exit 1; } os_type="$(lsb_release -si 2>/dev/null)" -if [ -z "$os_type" ] && [ -f "/etc/lsb-release" ]; then - os_type="$(. /etc/lsb-release && echo "$DISTRIB_ID")" +if [ -z "$os_type" ]; then + [ -f /etc/os-release ] && os_type="$(. /etc/os-release && echo "$ID")" + [ -f /etc/lsb-release ] && os_type="$(. /etc/lsb-release && echo "$DISTRIB_ID")" + [ "$os_type" = "debian" ] && os_type=Debian + [ "$os_type" = "ubuntu" ] && os_type=Ubuntu fi if [ "$os_type" != "Ubuntu" ] && [ "$os_type" != "Debian" ] && [ "$os_type" != "Raspbian" ]; then exiterr "This script only supports Ubuntu/Debian." diff --git a/vpnsetup.sh b/vpnsetup.sh index dca0e84..e44f766 100755 --- a/vpnsetup.sh +++ b/vpnsetup.sh @@ -47,8 +47,11 @@ check_ip() { } os_type="$(lsb_release -si 2>/dev/null)" -if [ -z "$os_type" ] && [ -f "/etc/lsb-release" ]; then - os_type="$(. /etc/lsb-release && echo "$DISTRIB_ID")" +if [ -z "$os_type" ]; then + [ -f /etc/os-release ] && os_type="$(. /etc/os-release && echo "$ID")" + [ -f /etc/lsb-release ] && os_type="$(. /etc/lsb-release && echo "$DISTRIB_ID")" + [ "$os_type" = "debian" ] && os_type=Debian + [ "$os_type" = "ubuntu" ] && os_type=Ubuntu fi if [ "$os_type" != "Ubuntu" ] && [ "$os_type" != "Debian" ] && [ "$os_type" != "Raspbian" ]; then exiterr "This script only supports Ubuntu/Debian."