From cb148ab90c9709100be6b20773fb9e6ce75295f4 Mon Sep 17 00:00:00 2001 From: blakeflei Date: Tue, 5 Nov 2024 19:23:55 -0500 Subject: [PATCH 1/5] update seeip address --- openvpn-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 6c6a647..d9397b1 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -627,11 +627,11 @@ function installOpenVPN() { # Behind NAT, we'll default to the publicly reachable IPv4/IPv6. if [[ $IPV6_SUPPORT == "y" ]]; then - if ! PUBLIC_IP=$(curl -f --retry 5 --retry-connrefused https://ip.seeip.org); then + if ! PUBLIC_IP=$(curl -f --retry 5 --retry-connrefused https://api.seeip.org); then PUBLIC_IP=$(dig -6 TXT +short o-o.myaddr.l.google.com @ns1.google.com | tr -d '"') fi else - if ! PUBLIC_IP=$(curl -f --retry 5 --retry-connrefused -4 https://ip.seeip.org); then + if ! PUBLIC_IP=$(curl -f --retry 5 --retry-connrefused -4 https://api.seeip.org); then PUBLIC_IP=$(dig -4 TXT +short o-o.myaddr.l.google.com @ns1.google.com | tr -d '"') fi fi From 28848ccd993aa94c55a6545d9f5c945c3a2eeb06 Mon Sep 17 00:00:00 2001 From: blakeflei Date: Tue, 5 Nov 2024 19:30:35 -0500 Subject: [PATCH 2/5] add support for al2023 --- openvpn-install.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index d9397b1..f9fe186 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -75,8 +75,11 @@ function checkOS() { fi fi if [[ $ID == "amzn" ]]; then - OS="amzn" - if [[ $VERSION_ID != "2" ]]; then + if [[ $VERSION_ID == "2" ]]; then + OS="amzn" + elif [[ $VERSION_ID == "2023" ]]; then + OS="amzn2023" + else echo "⚠️ Your version of Amazon Linux is not supported." echo "" echo "The script only support Amazon Linux 2." @@ -685,6 +688,8 @@ function installOpenVPN() { elif [[ $OS == 'amzn' ]]; then amazon-linux-extras install -y epel yum install -y openvpn iptables openssl wget ca-certificates curl + elif [[ $OS == 'amzn2023' ]]; then + dnf install -y openvpn iptables openssl wget ca-certificates elif [[ $OS == 'fedora' ]]; then dnf install -y openvpn iptables openssl wget ca-certificates curl policycoreutils-python-utils elif [[ $OS == 'arch' ]]; then @@ -924,7 +929,7 @@ verb 3" >>/etc/openvpn/server.conf fi # Finally, restart and enable OpenVPN - if [[ $OS == 'arch' || $OS == 'fedora' || $OS == 'centos' || $OS == 'oracle' ]]; then + if [[ $OS == 'arch' || $OS == 'fedora' || $OS == 'centos' || $OS == 'oracle' || $OS == 'amzn2023' ]]; then # Don't modify package-provided service cp /usr/lib/systemd/system/openvpn-server@.service /etc/systemd/system/openvpn-server@.service @@ -1342,3 +1347,4 @@ if [[ -e /etc/openvpn/server.conf && $AUTO_INSTALL != "y" ]]; then else installOpenVPN fi + From b5b85f97cf0d4eb61d98395ecd96cf993b87a102 Mon Sep 17 00:00:00 2001 From: blakeflei Date: Tue, 5 Nov 2024 19:32:08 -0500 Subject: [PATCH 3/5] fix spacing --- openvpn-install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index f9fe186..b7f72ce 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -1347,4 +1347,3 @@ if [[ -e /etc/openvpn/server.conf && $AUTO_INSTALL != "y" ]]; then else installOpenVPN fi - From 207c6c9fc279630f37417c49be405ca577ba1235 Mon Sep 17 00:00:00 2001 From: blakeflei Date: Wed, 6 Nov 2024 17:53:07 -0500 Subject: [PATCH 4/5] specify al2023.6 --- openvpn-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100755 => 100644 openvpn-install.sh diff --git a/openvpn-install.sh b/openvpn-install.sh old mode 100755 new mode 100644 index b7f72ce..34c360f --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -77,12 +77,12 @@ function checkOS() { if [[ $ID == "amzn" ]]; then if [[ $VERSION_ID == "2" ]]; then OS="amzn" - elif [[ $VERSION_ID == "2023" ]]; then + elif [ "$(echo $PRETTY_NAME | cut -c 1-19)" == "Amazon Linux 2023.6" ]; then OS="amzn2023" else echo "⚠️ Your version of Amazon Linux is not supported." echo "" - echo "The script only support Amazon Linux 2." + echo "The script only support Amazon Linux 2 or Amazon Linux 2023.6" echo "" exit 1 fi From 3aa3fdd51d4ef069744e54862704d687a50279bf Mon Sep 17 00:00:00 2001 From: blakeflei Date: Thu, 7 Nov 2024 08:56:06 -0500 Subject: [PATCH 5/5] add second parentheses --- openvpn-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 34c360f..7807400 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -77,7 +77,7 @@ function checkOS() { if [[ $ID == "amzn" ]]; then if [[ $VERSION_ID == "2" ]]; then OS="amzn" - elif [ "$(echo $PRETTY_NAME | cut -c 1-19)" == "Amazon Linux 2023.6" ]; then + elif [[ "$(echo $PRETTY_NAME | cut -c 1-19)" == "Amazon Linux 2023.6" ]]; then OS="amzn2023" else echo "⚠️ Your version of Amazon Linux is not supported."