diff --git a/extras/vpnupgrade.sh b/extras/vpnupgrade.sh index 713e76a..c760db0 100755 --- a/extras/vpnupgrade.sh +++ b/extras/vpnupgrade.sh @@ -14,8 +14,9 @@ # Attribution required: please include my name in any derivative and let me # know how you have improved it! -# Specify which Libreswan version to install. See: https://libreswan.org -SWAN_VER=4.6 +# (Optional) Specify which Libreswan version to install. See: https://libreswan.org +# NOTE: If not specified, the latest supported version will be installed. +SWAN_VER= ### DO NOT edit below this line ### @@ -91,40 +92,6 @@ EOF } check_libreswan() { - if [ "$os_type" != "alpine" ]; then - case $SWAN_VER in - 3.32|4.[1-6]) - true - ;; - *) -cat 1>&2 <&2 </dev/null) if ! printf '%s' "$ipsec_ver" | grep -q "Libreswan"; then cat 1>&2 <<'EOF' diff --git a/extras/vpnupgrade_alpine.sh b/extras/vpnupgrade_alpine.sh index 90fbb2c..b6d2e9b 100755 --- a/extras/vpnupgrade_alpine.sh +++ b/extras/vpnupgrade_alpine.sh @@ -39,7 +39,6 @@ check_vz() { check_os() { 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") case $os_type in [Aa]lpine) @@ -139,9 +138,6 @@ EOF } start_setup() { - # shellcheck disable=SC2154 - trap 'dlo=$dl;dl=$LINENO' DEBUG 2>/dev/null - trap 'finish $? $((dlo+1))' EXIT mkdir -p /opt/src cd /opt/src || exit 1 } @@ -287,28 +283,6 @@ EOF fi } -check_swan_ver() { - swan_ver_cur=4.6 - swan_ver_url="https://dl.ls20.com/v1/$os_type/$os_ver/swanverupg?arch=$os_arch&ver1=$swan_ver_old&ver2=$SWAN_VER" - [ "$1" != "0" ] && swan_ver_url="$swan_ver_url&e=$2" - swan_ver_latest=$(wget -t 3 -T 15 -qO- "$swan_ver_url" | head -n 1) - if printf '%s' "$swan_ver_latest" | grep -Eq '^([3-9]|[1-9][0-9]{1,2})(\.([0-9]|[1-9][0-9]{1,2})){1,2}$' \ - && [ "$1" = "0" ] && [ "$swan_ver_cur" != "$swan_ver_latest" ] \ - && printf '%s\n%s' "$swan_ver_cur" "$swan_ver_latest" | sort -C -V; then -cat </dev/null - trap 'finish $? $((dlo+1))' EXIT mkdir -p /opt/src cd /opt/src || exit 1 } @@ -275,28 +271,6 @@ EOF fi } -check_swan_ver() { - swan_ver_cur=4.6 - swan_ver_url="https://dl.ls20.com/v1/amzn/2/swanverupg?arch=$os_arch&ver1=$swan_ver_old&ver2=$SWAN_VER" - [ "$1" != "0" ] && swan_ver_url="$swan_ver_url&e=$2" - swan_ver_latest=$(wget -t 3 -T 15 -qO- "$swan_ver_url" | head -n 1) - if printf '%s' "$swan_ver_latest" | grep -Eq '^([3-9]|[1-9][0-9]{1,2})(\.([0-9]|[1-9][0-9]{1,2})){1,2}$' \ - && [ "$1" = "0" ] && [ "$swan_ver_cur" != "$swan_ver_latest" ] \ - && printf '%s\n%s' "$swan_ver_cur" "$swan_ver_latest" | sort -C -V; then -cat </dev/null - trap 'finish $? $((dlo+1))' EXIT mkdir -p /opt/src cd /opt/src || exit 1 } @@ -311,28 +307,6 @@ EOF fi } -check_swan_ver() { - swan_ver_cur=4.6 - swan_ver_url="https://dl.ls20.com/v1/$os_type/$os_ver/swanverupg?arch=$os_arch&ver1=$swan_ver_old&ver2=$SWAN_VER" - [ "$1" != "0" ] && swan_ver_url="$swan_ver_url&e=$2" - swan_ver_latest=$(wget -t 3 -T 15 -qO- "$swan_ver_url" | head -n 1) - if printf '%s' "$swan_ver_latest" | grep -Eq '^([3-9]|[1-9][0-9]{1,2})(\.([0-9]|[1-9][0-9]{1,2})){1,2}$' \ - && [ "$1" = "0" ] && [ "$swan_ver_cur" != "$swan_ver_latest" ] \ - && printf '%s\n%s' "$swan_ver_cur" "$swan_ver_latest" | sort -C -V; then -cat </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") case $os_type in [Uu]buntu) @@ -149,9 +148,6 @@ EOF } start_setup() { - # shellcheck disable=SC2154 - trap 'dlo=$dl;dl=$LINENO' DEBUG 2>/dev/null - trap 'finish $? $((dlo+1))' EXIT mkdir -p /opt/src cd /opt/src || exit 1 } @@ -318,28 +314,6 @@ EOF fi } -check_swan_ver() { - swan_ver_cur=4.6 - swan_ver_url="https://dl.ls20.com/v1/$os_type/$os_ver/swanverupg?arch=$os_arch&ver1=$swan_ver_old&ver2=$SWAN_VER" - [ "$1" != "0" ] && swan_ver_url="$swan_ver_url&e=$2" - swan_ver_latest=$(wget -t 3 -T 15 -qO- "$swan_ver_url" | head -n 1) - if printf '%s' "$swan_ver_latest" | grep -Eq '^([3-9]|[1-9][0-9]{1,2})(\.([0-9]|[1-9][0-9]{1,2})){1,2}$' \ - && [ "$1" = "0" ] && [ "$swan_ver_cur" != "$swan_ver_latest" ] \ - && printf '%s\n%s' "$swan_ver_cur" "$swan_ver_latest" | sort -C -V; then -cat <