From 6850aa7f3baa05f99a69548bbe10b948d5e876e5 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Wed, 2 Mar 2022 21:46:15 -0600 Subject: [PATCH] Update IKEv2 script - Change the warning for parameter "--auto" to an error, in cases that IKEv2 is already set up on the server. --- extras/ikev2setup.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extras/ikev2setup.sh b/extras/ikev2setup.sh index 6ea9496..a2ca305 100755 --- a/extras/ikev2setup.sh +++ b/extras/ikev2setup.sh @@ -150,7 +150,7 @@ confirm_or_abort() { show_header() { cat <<'EOF' -IKEv2 Script Copyright (c) 2020-2022 Lin Song 26 Feb 2022 +IKEv2 Script Copyright (c) 2020-2022 Lin Song 3 Mar 2022 EOF } @@ -204,7 +204,9 @@ check_cert_status() { check_arguments() { if [ "$use_defaults" = "1" ] && check_ikev2_exists; then - echo "Warning: Ignoring parameter '--auto'. Use '-h' for usage information." >&2 + echo "Error: Invalid parameter '--auto'. IKEv2 is already set up on this server." >&2 + echo " To manage VPN clients, re-run this script without '--auto'." >&2 + exit 1 fi if [ "$((add_client + export_client + list_clients + revoke_client))" -gt 1 ]; then show_usage "Invalid parameters. Specify only one of '--addclient', '--exportclient', '--listclients' or '--revokeclient'."