1
0
mirror of synced 2024-11-27 15:26:08 +03:00

Compare commits

..

No commits in common. "30f0f598e4470280991a61c16d91771b3e64c348" and "160fbe70a81e0b7c90034fd216ac3f3239c0519a" have entirely different histories.

6 changed files with 21 additions and 15 deletions

View File

@ -166,7 +166,7 @@ sudo VPN_PROTECT_CONFIG=yes sh vpn.sh
</details>
<details>
<summary>
如果无法下载,请点这里。
如果无法使用 wget 下载,请点这里。
</summary>
你也可以使用 `curl` 下载。例如:

View File

@ -166,7 +166,7 @@ sudo VPN_PROTECT_CONFIG=yes sh vpn.sh
</details>
<details>
<summary>
Click here if you are unable to download.
Click here if you are unable to download using wget.
</summary>
You may also use `curl` to download. For example:

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 143 KiB

View File

@ -151,7 +151,7 @@ confirm_or_abort() {
show_header() {
cat <<'EOF'
IKEv2 Script Copyright (c) 2020-2022 Lin Song 8 May 2022
IKEv2 Script Copyright (c) 2020-2022 Lin Song 30 Apr 2022
EOF
}
@ -1300,15 +1300,6 @@ cat 1>&2 <<EOF
Error: IKEv2 configuration section found in $IPSEC_CONF.
This script cannot automatically remove IKEv2 from this server.
To manually remove IKEv2, see vpnsetup.net/ikev2
EOF
abort_and_exit
fi
if grep -qs "ikev1-policy=drop" "$IPSEC_CONF" \
|| grep -qs "ikev1-policy=reject" "$IPSEC_CONF"; then
cat 1>&2 <<EOF
Error: IKEv2-only mode is currently enabled on this VPN server.
You must first disable IKEv2-only mode before removing IKEv2.
Otherwise, you will NOT be able to connect to this VPN server.
EOF
abort_and_exit
fi

View File

@ -310,7 +310,7 @@ remove_vpn() {
print_vpn_removed() {
echo
echo "IPsec VPN removed! Please reboot your server. This is optional, but recommended."
echo "IPsec VPN removed! Please reboot your server."
}
vpnuninstall() {

View File

@ -80,6 +80,7 @@ check_os() {
exiterr "This script only supports Ubuntu and Debian."
;;
esac
os_arch=$(uname -m | tr -dc 'A-Za-z0-9_-')
os_ver=$(sed 's/\..*//' /etc/debian_version | tr -dc 'A-Za-z0-9')
if [ "$os_ver" = "8" ] || [ "$os_ver" = "jessiesid" ]; then
exiterr "Debian 8 or Ubuntu < 16.04 is not supported."
@ -535,6 +536,19 @@ apply_gcp_mtu_fix() {
fi
}
apply_xl2tpd_fix() {
if [ "$os_type" = "ubuntu" ] && [ "$os_ver" = "bookwormsid" ] && [ "$os_arch" = "x86_64" ]; then
xl2tpd_url="https://mirrors.kernel.org/ubuntu/pool/universe/x/xl2tpd"
deb_file="xl2tpd_1.3.16-1ubuntu0.1_amd64.deb"
cd /opt/src || exit 1
if wget -t 3 -T 30 -q -O "$deb_file" "$xl2tpd_url/$deb_file"; then
bigecho "Applying fix for xl2tpd..."
apt-get -yqq install "./$deb_file" >/dev/null
fi
/bin/rm -f "$deb_file"
fi
}
enable_on_boot() {
bigecho "Enabling services on boot..."
IPT_PST=/etc/init.d/iptables-persistent
@ -633,7 +647,7 @@ IKEv2 guide: vpnsetup.net/ikev2
EOF
if [ ! -e /dev/ppp ]; then
cat <<'EOF'
WARNING: /dev/ppp is missing, and IPsec/L2TP mode may not work. Please use
Warning: /dev/ppp is missing, and IPsec/L2TP mode may not work. Please use
IKEv2 (vpnsetup.net/ikev2) or IPsec/XAuth mode to connect.
Debian 11/10 users, see vpnsetup.net/debian10
@ -687,6 +701,7 @@ vpnsetup() {
create_vpn_config
update_sysctl
update_iptables
apply_xl2tpd_fix
apply_gcp_mtu_fix
enable_on_boot
start_services