add amazon ami: better OS detect

This commit is contained in:
Ben Menking 2018-11-01 03:04:28 +00:00
parent e03c911987
commit 037197f4cd

View file

@ -67,7 +67,7 @@ function checkOS () {
fi fi
fi fi
OS=centos OS=centos
elif [[ -e /etc/os-release ]]; then elif [[ -e /etc/system-release && `grep -is "Amazon Linux" /etc/system-release` ]]; then
OS=amazon OS=amazon
elif [[ -e /etc/arch-release ]]; then elif [[ -e /etc/arch-release ]]; then
OS=arch OS=arch
@ -1147,6 +1147,8 @@ function removeOpenVPN () {
yum remove -y openvpn yum remove -y openvpn
elif [[ "$OS" = 'fedora' ]]; then elif [[ "$OS" = 'fedora' ]]; then
dnf remove -y openvpn dnf remove -y openvpn
elif [[ "$OS" = 'amazon' ]]; then
yum -y remove openvpn
fi fi
# Cleanup # Cleanup