diff --git a/openvpn-install.sh b/openvpn-install.sh index 6c6a647..2dd4d7e 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -79,11 +79,16 @@ function checkOS() { if [[ $VERSION_ID != "2" ]]; then echo "⚠️ Your version of Amazon Linux is not supported." echo "" - echo "The script only support Amazon Linux 2." + echo "However, if you're using Amazon Linux >= 2023 or beta, then you can continue, at your own risk." echo "" - exit 1 + until [[ $CONTINUE =~ (y|n) ]]; do + read -rp "Continue? [y/n]: " -e CONTINUE + done + if [[ $CONTINUE == "n" ]]; then + exit 1 fi fi + fi elif [[ -e /etc/arch-release ]]; then OS=arch else @@ -683,8 +688,25 @@ function installOpenVPN() { yum-config-manager --enable ol8_developer_EPEL yum install -y openvpn iptables openssl wget ca-certificates curl tar policycoreutils-python-utils elif [[ $OS == 'amzn' ]]; then - amazon-linux-extras install -y epel - yum install -y openvpn iptables openssl wget ca-certificates curl + if [[ $VERSION_ID == "2023" ]]; then + # Add Fedora 36 repository because Amazon Linux 2023 is based on Fedora 34, 35, 36 + sudo tee /etc/yum.repos.d/fedora.repo </usr/lib/systemd/system/openvpn@.service + +sudo systemctl daemon-reload +fi + # Find out if the machine uses nogroup or nobody for the permissionless group if grep -qs "^nogroup:" /etc/group; then NOGROUP=nogroup @@ -1341,4 +1380,4 @@ if [[ -e /etc/openvpn/server.conf && $AUTO_INSTALL != "y" ]]; then manageMenu else installOpenVPN -fi +fi \ No newline at end of file