From 037197f4cd44403ec4ebf03b9f0e389e7821461f Mon Sep 17 00:00:00 2001 From: Ben Menking Date: Thu, 1 Nov 2018 03:04:28 +0000 Subject: [PATCH] add amazon ami: better OS detect --- openvpn-install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 0f85026..4f1130a 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -67,7 +67,7 @@ function checkOS () { fi fi OS=centos - elif [[ -e /etc/os-release ]]; then + elif [[ -e /etc/system-release && `grep -is "Amazon Linux" /etc/system-release` ]]; then OS=amazon elif [[ -e /etc/arch-release ]]; then OS=arch @@ -1147,6 +1147,8 @@ function removeOpenVPN () { yum remove -y openvpn elif [[ "$OS" = 'fedora' ]]; then dnf remove -y openvpn + elif [[ "$OS" = 'amazon' ]]; then + yum -y remove openvpn fi # Cleanup