Improve VPN setup

- Display a message if IKEv2 is already set up on the VPN server.
This commit is contained in:
hwdsl2 2022-03-06 22:41:29 -06:00
parent b6c54c316f
commit 40859c5f7f
4 changed files with 40 additions and 0 deletions

View File

@ -538,6 +538,16 @@ set_up_ikev2() {
VPN_DNS_SRV1="$VPN_DNS_SRV1" VPN_DNS_SRV2="$VPN_DNS_SRV2" \
VPN_PROTECT_CONFIG="$VPN_PROTECT_CONFIG" \
/bin/bash /opt/src/ikev2.sh --auto || status=1
elif [ -s /opt/src/ikev2.sh ]; then
cat <<'EOF'
================================================
IKEv2 is already set up on this server.
To manage IKEv2 clients, run: sudo ikev2.sh
================================================
EOF
fi
}

View File

@ -551,6 +551,16 @@ set_up_ikev2() {
VPN_DNS_SRV1="$VPN_DNS_SRV1" VPN_DNS_SRV2="$VPN_DNS_SRV2" \
VPN_PROTECT_CONFIG="$VPN_PROTECT_CONFIG" \
/bin/bash /opt/src/ikev2.sh --auto || status=1
elif [ -s /opt/src/ikev2.sh ]; then
cat <<'EOF'
================================================
IKEv2 is already set up on this server.
To manage IKEv2 clients, run: sudo ikev2.sh
================================================
EOF
fi
}

View File

@ -664,6 +664,16 @@ set_up_ikev2() {
VPN_DNS_SRV1="$VPN_DNS_SRV1" VPN_DNS_SRV2="$VPN_DNS_SRV2" \
VPN_PROTECT_CONFIG="$VPN_PROTECT_CONFIG" \
/bin/bash /opt/src/ikev2.sh --auto || status=1
elif [ -s /opt/src/ikev2.sh ]; then
cat <<'EOF'
================================================
IKEv2 is already set up on this server.
To manage IKEv2 clients, run: sudo ikev2.sh
================================================
EOF
fi
}

View File

@ -652,6 +652,16 @@ set_up_ikev2() {
VPN_DNS_SRV1="$VPN_DNS_SRV1" VPN_DNS_SRV2="$VPN_DNS_SRV2" \
VPN_PROTECT_CONFIG="$VPN_PROTECT_CONFIG" \
/bin/bash /opt/src/ikev2.sh --auto || status=1
elif [ -s /opt/src/ikev2.sh ]; then
cat <<'EOF'
================================================
IKEv2 is already set up on this server.
To manage IKEv2 clients, run: sudo ikev2.sh
================================================
EOF
fi
}