1
0
mirror of synced 2025-02-21 14:33:17 +03:00

Update IKEv2-only mode script

- Improve Libreswan version test
This commit is contained in:
hwdsl2 2022-01-29 14:46:10 -06:00
parent 2270d66e02
commit 40d8a26713

View File

@ -62,20 +62,18 @@ Error: Your must first set up IKEv2 before selecting IKEv2-only mode.
EOF EOF
exit 1 exit 1
fi fi
case $swan_ver in }
4.[2-9]|4.[1-9][0-9])
true check_swan_ver() {
;; if ! printf '%s\n%s' "4.2" "$swan_ver" | sort -C -V; then
*)
cat 1>&2 <<EOF cat 1>&2 <<EOF
Error: Libreswan version '$swan_ver' is not supported. Error: Libreswan version '$swan_ver' is not supported.
IKEv2-only mode requires Libreswan 4.2 or newer. IKEv2-only mode requires Libreswan 4.2 or newer.
To update Libreswan, run: To update Libreswan, run:
wget https://git.io/vpnupgrade -O vpnup.sh && sudo sh vpnup.sh wget https://git.io/vpnupgrade -O vpnup.sh && sudo sh vpnup.sh
EOF EOF
exit 1 exit 1
;; fi
esac
} }
get_ikev2_only_status() { get_ikev2_only_status() {
@ -157,6 +155,7 @@ EOF
ikev2onlymode() { ikev2onlymode() {
check_root check_root
check_libreswan check_libreswan
check_swan_ver
get_ikev2_only_status get_ikev2_only_status
select_menu_option select_menu_option
case $selected_option in case $selected_option in