Add new option
- Add an option for specifying a Libreswan version to install, using variable VPN_SWAN_VER. Currently supported values are 4.15 and 5.0. This could be useful for users who want to install the older Libreswan version 4.
This commit is contained in:
parent
0b1eaf64b8
commit
bea8597b02
@ -280,7 +280,7 @@ run_setup() {
|
||||
VPN_DNS_NAME="$VPN_DNS_NAME" VPN_CLIENT_NAME="$VPN_CLIENT_NAME" \
|
||||
VPN_PROTECT_CONFIG="$VPN_PROTECT_CONFIG" \
|
||||
VPN_CLIENT_VALIDITY="$VPN_CLIENT_VALIDITY" \
|
||||
VPN_SKIP_IKEV2="$VPN_SKIP_IKEV2" \
|
||||
VPN_SKIP_IKEV2="$VPN_SKIP_IKEV2" VPN_SWAN_VER="$VPN_SWAN_VER" \
|
||||
/bin/bash "$tmpdir/vpn.sh" || status=1
|
||||
else
|
||||
status=1
|
||||
|
@ -248,6 +248,18 @@ get_swan_ver() {
|
||||
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}$'; then
|
||||
SWAN_VER="$swan_ver_latest"
|
||||
fi
|
||||
if [ -n "$VPN_SWAN_VER" ]; then
|
||||
if ! printf '%s\n%s' "4.15" "$VPN_SWAN_VER" | sort -C -V \
|
||||
|| ! printf '%s\n%s' "$VPN_SWAN_VER" "$SWAN_VER" | sort -C -V; then
|
||||
cat 1>&2 <<EOF
|
||||
Error: Libreswan version '$VPN_SWAN_VER' is not supported.
|
||||
This script can install Libreswan 4.15+ or $SWAN_VER.
|
||||
EOF
|
||||
exit 1
|
||||
else
|
||||
SWAN_VER="$VPN_SWAN_VER"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
check_libreswan() {
|
||||
|
@ -266,6 +266,18 @@ get_swan_ver() {
|
||||
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}$'; then
|
||||
SWAN_VER="$swan_ver_latest"
|
||||
fi
|
||||
if [ -n "$VPN_SWAN_VER" ]; then
|
||||
if ! printf '%s\n%s' "4.15" "$VPN_SWAN_VER" | sort -C -V \
|
||||
|| ! printf '%s\n%s' "$VPN_SWAN_VER" "$SWAN_VER" | sort -C -V; then
|
||||
cat 1>&2 <<EOF
|
||||
Error: Libreswan version '$VPN_SWAN_VER' is not supported.
|
||||
This script can install Libreswan 4.15+ or $SWAN_VER.
|
||||
EOF
|
||||
exit 1
|
||||
else
|
||||
SWAN_VER="$VPN_SWAN_VER"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
check_libreswan() {
|
||||
|
@ -368,6 +368,18 @@ get_swan_ver() {
|
||||
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}$'; then
|
||||
SWAN_VER="$swan_ver_latest"
|
||||
fi
|
||||
if [ -n "$VPN_SWAN_VER" ]; then
|
||||
if ! printf '%s\n%s' "4.15" "$VPN_SWAN_VER" | sort -C -V \
|
||||
|| ! printf '%s\n%s' "$VPN_SWAN_VER" "$SWAN_VER" | sort -C -V; then
|
||||
cat 1>&2 <<EOF
|
||||
Error: Libreswan version '$VPN_SWAN_VER' is not supported.
|
||||
This script can install Libreswan 4.15+ or $SWAN_VER.
|
||||
EOF
|
||||
exit 1
|
||||
else
|
||||
SWAN_VER="$VPN_SWAN_VER"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
check_libreswan() {
|
||||
|
@ -321,6 +321,18 @@ get_swan_ver() {
|
||||
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}$'; then
|
||||
SWAN_VER="$swan_ver_latest"
|
||||
fi
|
||||
if [ -n "$VPN_SWAN_VER" ]; then
|
||||
if ! printf '%s\n%s' "4.15" "$VPN_SWAN_VER" | sort -C -V \
|
||||
|| ! printf '%s\n%s' "$VPN_SWAN_VER" "$SWAN_VER" | sort -C -V; then
|
||||
cat 1>&2 <<EOF
|
||||
Error: Libreswan version '$VPN_SWAN_VER' is not supported.
|
||||
This script can install Libreswan 4.15+ or $SWAN_VER.
|
||||
EOF
|
||||
exit 1
|
||||
else
|
||||
SWAN_VER="$VPN_SWAN_VER"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
check_libreswan() {
|
||||
|
Loading…
Reference in New Issue
Block a user