This commit is contained in:
hwdsl2 2021-08-07 16:12:26 -05:00
parent 688a700fd6
commit 6daacff466
9 changed files with 31 additions and 47 deletions

View File

@ -78,7 +78,7 @@ sudo VPN_DNS_SRV1=1.1.1.1 VPN_DNS_SRV2=1.0.0.1 ikev2.sh --auto
</details> </details>
<details> <details>
<summary> <summary>
单击此处查看 IKEv2 辅助脚本的使用信息。 单击此处查看 IKEv2 脚本的使用信息。
</summary> </summary>
``` ```
@ -86,10 +86,10 @@ Usage: bash ikev2.sh [options]
Options: Options:
--auto run IKEv2 setup in auto mode using default options (for initial setup only) --auto run IKEv2 setup in auto mode using default options (for initial setup only)
--addclient [client name] add a new client using default options (after IKEv2 setup) --addclient [client name] add a new client using default options
--exportclient [client name] export configuration for an existing client (after IKEv2 setup) --exportclient [client name] export configuration for an existing client
--listclients list the names of existing clients (after IKEv2 setup) --listclients list the names of existing clients
--revokeclient revoke a client certificate (after IKEv2 setup) --revokeclient revoke a client certificate
--removeikev2 remove IKEv2 and delete all certificates and keys from the IPsec database --removeikev2 remove IKEv2 and delete all certificates and keys from the IPsec database
-h, --help show this help message and exit -h, --help show this help message and exit

View File

@ -78,7 +78,7 @@ sudo VPN_DNS_SRV1=1.1.1.1 VPN_DNS_SRV2=1.0.0.1 ikev2.sh --auto
</details> </details>
<details> <details>
<summary> <summary>
Click here to view usage information for the IKEv2 helper script. Click here to view usage information for the IKEv2 script.
</summary> </summary>
``` ```
@ -86,10 +86,10 @@ Usage: bash ikev2.sh [options]
Options: Options:
--auto run IKEv2 setup in auto mode using default options (for initial setup only) --auto run IKEv2 setup in auto mode using default options (for initial setup only)
--addclient [client name] add a new client using default options (after IKEv2 setup) --addclient [client name] add a new client using default options
--exportclient [client name] export configuration for an existing client (after IKEv2 setup) --exportclient [client name] export configuration for an existing client
--listclients list the names of existing clients (after IKEv2 setup) --listclients list the names of existing clients
--revokeclient revoke a client certificate (after IKEv2 setup) --revokeclient revoke a client certificate
--removeikev2 remove IKEv2 and delete all certificates and keys from the IPsec database --removeikev2 remove IKEv2 and delete all certificates and keys from the IPsec database
-h, --help show this help message and exit -h, --help show this help message and exit

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
# Script to add/update an VPN user for both IPsec/L2TP and Cisco IPsec # Script to add/update a VPN user for both IPsec/L2TP and Cisco IPsec
# #
# Copyright (C) 2018-2021 Lin Song <linsongui@gmail.com> # Copyright (C) 2018-2021 Lin Song <linsongui@gmail.com>
# #
@ -54,11 +54,9 @@ case "$VPN_USER $VPN_PASSWORD" in
;; ;;
esac esac
clear
cat <<EOF cat <<EOF
Welcome! This script will add or update an VPN user account for both Welcome! Use this script to add or update a VPN user account for both
IPsec/L2TP and IPsec/XAuth ("Cisco IPsec") modes. IPsec/L2TP and IPsec/XAuth ("Cisco IPsec") modes.
If the username you specified already exists, it will be updated If the username you specified already exists, it will be updated

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
# Script to delete an VPN user for both IPsec/L2TP and Cisco IPsec # Script to delete a VPN user for both IPsec/L2TP and Cisco IPsec
# #
# Copyright (C) 2018-2021 Lin Song <linsongui@gmail.com> # Copyright (C) 2018-2021 Lin Song <linsongui@gmail.com>
# #
@ -68,11 +68,9 @@ EOF
exit 1 exit 1
fi fi
clear
cat <<EOF cat <<EOF
Welcome! This script will delete an VPN user account for both Welcome! Use this script to delete a VPN user account for both
IPsec/L2TP and IPsec/XAuth ("Cisco IPsec") modes. IPsec/L2TP and IPsec/XAuth ("Cisco IPsec") modes.
Please double check before continuing! Please double check before continuing!

View File

@ -169,10 +169,10 @@ Usage: bash $0 [options]
Options: Options:
--auto run IKEv2 setup in auto mode using default options (for initial setup only) --auto run IKEv2 setup in auto mode using default options (for initial setup only)
--addclient [client name] add a new client using default options (after IKEv2 setup) --addclient [client name] add a new client using default options
--exportclient [client name] export configuration for an existing client (after IKEv2 setup) --exportclient [client name] export configuration for an existing client
--listclients list the names of existing clients (after IKEv2 setup) --listclients list the names of existing clients
--revokeclient Revoke a client certificate (after IKEv2 setup) --revokeclient revoke a client certificate
--removeikev2 remove IKEv2 and delete all certificates and keys from the IPsec database --removeikev2 remove IKEv2 and delete all certificates and keys from the IPsec database
-h, --help show this help message and exit -h, --help show this help message and exit
@ -344,8 +344,7 @@ select_swan_update() {
show_welcome() { show_welcome() {
cat <<'EOF' cat <<'EOF'
Welcome! Use this script to set up IKEv2 after setting up your own IPsec VPN server. Welcome! Use this script to set up IKEv2 on your IPsec VPN server.
Alternatively, you may manually set up IKEv2. See: https://git.io/ikev2
I need to ask you a few questions before starting setup. I need to ask you a few questions before starting setup.
You can use the default options and just press enter if you are OK with them. You can use the default options and just press enter if you are OK with them.
@ -548,10 +547,10 @@ enter_custom_dns() {
echo "Invalid DNS server." echo "Invalid DNS server."
read -rp "Enter primary DNS server: " dns_server_1 read -rp "Enter primary DNS server: " dns_server_1
done done
read -rp "Enter secondary DNS server (Enter to skip): " dns_server_2 read -rp "Enter secondary DNS server (enter to skip): " dns_server_2
until [ -z "$dns_server_2" ] || check_ip "$dns_server_2"; do until [ -z "$dns_server_2" ] || check_ip "$dns_server_2"; do
echo "Invalid DNS server." echo "Invalid DNS server."
read -rp "Enter secondary DNS server (Enter to skip): " dns_server_2 read -rp "Enter secondary DNS server (enter to skip): " dns_server_2
done done
if [ -n "$dns_server_2" ]; then if [ -n "$dns_server_2" ]; then
dns_servers="$dns_server_1 $dns_server_2" dns_servers="$dns_server_1 $dns_server_2"

View File

@ -83,11 +83,9 @@ if printf '%s' "$VPN_USERS" | tr ' ' '\n' | sort | uniq -c | grep -qv '^ *1 '; t
exiterr "VPN usernames must not contain duplicates." exiterr "VPN usernames must not contain duplicates."
fi fi
clear
cat <<'EOF' cat <<'EOF'
Welcome! This script will update VPN user accounts for both Welcome! Use this script to update VPN user accounts for both
IPsec/L2TP and IPsec/XAuth ("Cisco IPsec") modes. IPsec/L2TP and IPsec/XAuth ("Cisco IPsec") modes.
WARNING: *ALL* existing VPN users will be removed and replaced WARNING: *ALL* existing VPN users will be removed and replaced

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
# Script to upgrade Libreswan on Ubuntu and Debian # Script to update Libreswan on Ubuntu and Debian
# #
# The latest version of this script is available at: # The latest version of this script is available at:
# https://github.com/hwdsl2/setup-ipsec-vpn # https://github.com/hwdsl2/setup-ipsec-vpn
@ -123,12 +123,9 @@ if [ "$swan_ver_old" = "$SWAN_VER" ]; then
esac esac
fi fi
clear
cat <<EOF cat <<EOF
Welcome! This script will build and install Libreswan on your server.
Additional packages required for compilation will also be installed. Welcome! Use this script to update Libreswan on your IPsec VPN server.
It is intended for upgrading servers to a newer Libreswan version.
Current version: Libreswan $swan_ver_old Current version: Libreswan $swan_ver_old
Version to install: Libreswan $SWAN_VER Version to install: Libreswan $SWAN_VER

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
# Script to upgrade Libreswan on Amazon Linux 2 # Script to update Libreswan on Amazon Linux 2
# #
# The latest version of this script is available at: # The latest version of this script is available at:
# https://github.com/hwdsl2/setup-ipsec-vpn # https://github.com/hwdsl2/setup-ipsec-vpn
@ -102,12 +102,9 @@ if [ "$swan_ver_old" = "$SWAN_VER" ]; then
esac esac
fi fi
clear
cat <<EOF cat <<EOF
Welcome! This script will build and install Libreswan on your server.
Additional packages required for compilation will also be installed. Welcome! Use this script to update Libreswan on your IPsec VPN server.
It is intended for upgrading servers to a newer Libreswan version.
Current version: Libreswan $swan_ver_old Current version: Libreswan $swan_ver_old
Version to install: Libreswan $SWAN_VER Version to install: Libreswan $SWAN_VER

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
# Script to upgrade Libreswan on CentOS and RHEL # Script to update Libreswan on CentOS and RHEL
# #
# The latest version of this script is available at: # The latest version of this script is available at:
# https://github.com/hwdsl2/setup-ipsec-vpn # https://github.com/hwdsl2/setup-ipsec-vpn
@ -117,12 +117,9 @@ if [ "$swan_ver_old" = "$SWAN_VER" ]; then
esac esac
fi fi
clear
cat <<EOF cat <<EOF
Welcome! This script will build and install Libreswan on your server.
Additional packages required for compilation will also be installed. Welcome! Use this script to update Libreswan on your IPsec VPN server.
It is intended for upgrading servers to a newer Libreswan version.
Current version: Libreswan $swan_ver_old Current version: Libreswan $swan_ver_old
Version to install: Libreswan $SWAN_VER Version to install: Libreswan $SWAN_VER