diff --git a/extras/ikev2setup.sh b/extras/ikev2setup.sh index 49ce593..9367104 100755 --- a/extras/ikev2setup.sh +++ b/extras/ikev2setup.sh @@ -293,7 +293,7 @@ check_swan_ver() { swan_ver_url="https://dl.ls20.com/v1/docker/$os_type/$os_arch/swanverikev2?ver=$swan_ver&auto=$use_defaults" fi [ "$1" != "0" ] && swan_ver_url="$swan_ver_url&e=$2" - swan_ver_latest=$(wget -t 3 -T 15 -qO- "$swan_ver_url") + swan_ver_latest=$(wget -t 3 -T 15 -qO- "$swan_ver_url" | head -n 1) } show_update_info() { diff --git a/extras/vpnupgrade_alpine.sh b/extras/vpnupgrade_alpine.sh index 601affc..e17a478 100755 --- a/extras/vpnupgrade_alpine.sh +++ b/extras/vpnupgrade_alpine.sh @@ -278,7 +278,7 @@ check_swan_ver() { swan_ver_cur=4.5 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") + 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 diff --git a/extras/vpnupgrade_amzn.sh b/extras/vpnupgrade_amzn.sh index 803d5e1..c02f26e 100755 --- a/extras/vpnupgrade_amzn.sh +++ b/extras/vpnupgrade_amzn.sh @@ -261,7 +261,7 @@ check_swan_ver() { swan_ver_cur=4.5 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") + 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 diff --git a/extras/vpnupgrade_centos.sh b/extras/vpnupgrade_centos.sh index 0e3af7f..dc6ee9f 100755 --- a/extras/vpnupgrade_centos.sh +++ b/extras/vpnupgrade_centos.sh @@ -297,7 +297,7 @@ check_swan_ver() { swan_ver_cur=4.5 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") + 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 diff --git a/extras/vpnupgrade_ubuntu.sh b/extras/vpnupgrade_ubuntu.sh index 5abab5c..55ca894 100755 --- a/extras/vpnupgrade_ubuntu.sh +++ b/extras/vpnupgrade_ubuntu.sh @@ -304,7 +304,7 @@ check_swan_ver() { swan_ver_cur=4.5 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") + 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 diff --git a/vpnsetup_alpine.sh b/vpnsetup_alpine.sh index af1eb52..1105b89 100755 --- a/vpnsetup_alpine.sh +++ b/vpnsetup_alpine.sh @@ -506,7 +506,7 @@ EOF check_swan_ver() { swan_ver_url="https://dl.ls20.com/v1/$os_type/$os_ver/swanver?arch=$os_arch&ver=$SWAN_VER" [ "$1" != "0" ] && swan_ver_url="$swan_ver_url&e=$2" - swan_ver_latest=$(wget -t 3 -T 15 -qO- "$swan_ver_url") + 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" ] && [ -n "$SWAN_VER" ] && [ "$SWAN_VER" != "$swan_ver_latest" ] \ && printf '%s\n%s' "$SWAN_VER" "$swan_ver_latest" | sort -C -V; then diff --git a/vpnsetup_amzn.sh b/vpnsetup_amzn.sh index a733171..875fa7d 100755 --- a/vpnsetup_amzn.sh +++ b/vpnsetup_amzn.sh @@ -513,7 +513,7 @@ EOF check_swan_ver() { swan_ver_url="https://dl.ls20.com/v1/amzn/2/swanver?arch=$os_arch&ver=$SWAN_VER" [ "$1" != "0" ] && swan_ver_url="$swan_ver_url&e=$2" - swan_ver_latest=$(wget -t 3 -T 15 -qO- "$swan_ver_url") + 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" ] && [ -n "$SWAN_VER" ] && [ "$SWAN_VER" != "$swan_ver_latest" ] \ && printf '%s\n%s' "$SWAN_VER" "$swan_ver_latest" | sort -C -V; then diff --git a/vpnsetup_centos.sh b/vpnsetup_centos.sh index 450673a..eb7b637 100755 --- a/vpnsetup_centos.sh +++ b/vpnsetup_centos.sh @@ -609,7 +609,7 @@ EOF check_swan_ver() { swan_ver_url="https://dl.ls20.com/v1/$os_type/$os_ver/swanver?arch=$os_arch&ver=$SWAN_VER" [ "$1" != "0" ] && swan_ver_url="$swan_ver_url&e=$2" - swan_ver_latest=$(wget -t 3 -T 15 -qO- "$swan_ver_url") + 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" ] && [ -n "$SWAN_VER" ] && [ "$SWAN_VER" != "$swan_ver_latest" ] \ && printf '%s\n%s' "$SWAN_VER" "$swan_ver_latest" | sort -C -V; then diff --git a/vpnsetup_ubuntu.sh b/vpnsetup_ubuntu.sh index d030a49..49c5c04 100755 --- a/vpnsetup_ubuntu.sh +++ b/vpnsetup_ubuntu.sh @@ -597,7 +597,7 @@ EOF check_swan_ver() { swan_ver_url="https://dl.ls20.com/v1/$os_type/$os_ver/swanver?arch=$os_arch&ver=$SWAN_VER" [ "$1" != "0" ] && swan_ver_url="$swan_ver_url&e=$2" - swan_ver_latest=$(wget -t 3 -T 15 -qO- "$swan_ver_url") + 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" ] && [ -n "$SWAN_VER" ] && [ "$SWAN_VER" != "$swan_ver_latest" ] \ && printf '%s\n%s' "$SWAN_VER" "$swan_ver_latest" | sort -C -V; then