diff --git a/extras/ikev2setup.sh b/extras/ikev2setup.sh index ad6c92c..61efd90 100755 --- a/extras/ikev2setup.sh +++ b/extras/ikev2setup.sh @@ -100,13 +100,7 @@ confirm_or_abort() { } get_update_url() { - update_url=vpnupgrade - if [ "$os_type" = "centos" ] || [ "$os_type" = "rhel" ] || [ "$os_type" = "rocky" ] || [ "$os_type" = "alma" ]; then - update_url=vpnupgrade-centos - elif [ "$os_type" = "amzn" ]; then - update_url=vpnupgrade-amzn - fi - update_url="https://git.io/$update_url" + update_url="https://git.io/vpnupgrade" } check_swan_install() { diff --git a/extras/vpnupgrade_amzn.sh b/extras/vpnupgrade_amzn.sh index 81c2edb..ec7235e 100755 --- a/extras/vpnupgrade_amzn.sh +++ b/extras/vpnupgrade_amzn.sh @@ -26,12 +26,11 @@ bigecho() { echo "## $1"; } vpnupgrade() { +[ -n "$VPN_UPDATE_SWAN_VER" ] && SWAN_VER="$VPN_UPDATE_SWAN_VER" + os_arch=$(uname -m | tr -dc 'A-Za-z0-9_-') if ! grep -qs "Amazon Linux release 2" /etc/system-release; then - echo "Error: This script only supports Amazon Linux 2." >&2 - echo "For Ubuntu/Debian, use https://git.io/vpnupgrade" >&2 - echo "For CentOS/RHEL, use https://git.io/vpnupgrade-centos" >&2 - exit 1 + exiterr "This script only supports Amazon Linux 2." fi if [ "$(id -u)" != 0 ]; then @@ -70,7 +69,7 @@ if printf '%s' "$swan_ver_latest" | grep -Eq '^([3-9]|[1-9][0-9]{1,2})(\.([0-9]| && printf '%s\n%s' "$swan_ver_cur" "$swan_ver_latest" | sort -C -V; then echo "Note: A newer version of Libreswan ($swan_ver_latest) is available." echo " To update to the new version, exit this script and run:" - echo " wget https://git.io/vpnupgrade-amzn -O vpnup.sh && sudo sh vpnup.sh" + echo " wget https://git.io/vpnupgrade -O vpnup.sh && sudo sh vpnup.sh" echo printf "Do you want to continue anyway? [y/N] " read -r response diff --git a/extras/vpnupgrade_centos.sh b/extras/vpnupgrade_centos.sh index b9c134c..0fe5c5e 100755 --- a/extras/vpnupgrade_centos.sh +++ b/extras/vpnupgrade_centos.sh @@ -26,6 +26,8 @@ bigecho() { echo "## $1"; } vpnupgrade() { +[ -n "$VPN_UPDATE_SWAN_VER" ] && SWAN_VER="$VPN_UPDATE_SWAN_VER" + os_type=centos os_arch=$(uname -m | tr -dc 'A-Za-z0-9_-') rh_file="/etc/redhat-release" @@ -40,9 +42,7 @@ elif grep -qs "release 8" "$rh_file"; then grep -qi rocky "$rh_file" && os_type=rocky grep -qi alma "$rh_file" && os_type=alma else - echo "Error: This script only supports CentOS/RHEL 7 and 8." >&2 - echo "For Ubuntu/Debian, use https://git.io/vpnupgrade" >&2 - exit 1 + exiterr "This script only supports CentOS/RHEL 7 and 8." fi if [ -f /proc/user_beancounters ]; then @@ -85,7 +85,7 @@ if printf '%s' "$swan_ver_latest" | grep -Eq '^([3-9]|[1-9][0-9]{1,2})(\.([0-9]| && printf '%s\n%s' "$swan_ver_cur" "$swan_ver_latest" | sort -C -V; then echo "Note: A newer version of Libreswan ($swan_ver_latest) is available." echo " To update to the new version, exit this script and run:" - echo " wget https://git.io/vpnupgrade-centos -O vpnup.sh && sudo sh vpnup.sh" + echo " wget https://git.io/vpnupgrade -O vpnup.sh && sudo sh vpnup.sh" echo printf "Do you want to continue anyway? [y/N] " read -r response diff --git a/extras/vpnupgrade_ubuntu.sh b/extras/vpnupgrade_ubuntu.sh index 71e3e52..f955e5e 100755 --- a/extras/vpnupgrade_ubuntu.sh +++ b/extras/vpnupgrade_ubuntu.sh @@ -26,6 +26,8 @@ bigecho() { echo "## $1"; } vpnupgrade() { +[ -n "$VPN_UPDATE_SWAN_VER" ] && SWAN_VER="$VPN_UPDATE_SWAN_VER" + os_type=$(lsb_release -si 2>/dev/null) os_arch=$(uname -m | tr -dc 'A-Za-z0-9_-') [ -z "$os_type" ] && [ -f /etc/os-release ] && os_type=$(. /etc/os-release && printf '%s' "$ID") @@ -40,9 +42,7 @@ case $os_type in os_type=raspbian ;; *) - echo "Error: This script only supports Ubuntu and Debian." >&2 - echo "For CentOS/RHEL, use https://git.io/vpnupgrade-centos" >&2 - exit 1 + exiterr "This script only supports Ubuntu and Debian." ;; esac diff --git a/vpnsetup_amzn.sh b/vpnsetup_amzn.sh index 2cd92f1..f9a41f9 100755 --- a/vpnsetup_amzn.sh +++ b/vpnsetup_amzn.sh @@ -451,7 +451,7 @@ cat <