From abbf19f29604b9131f6dc79dd28d5f5bb3724d63 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Tue, 4 Jan 2022 23:10:28 -0600 Subject: [PATCH] Update IKEv2 script - Sort IKEv2 client names when listing existing clients - Cleanup --- extras/ikev2setup.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/extras/ikev2setup.sh b/extras/ikev2setup.sh index 9367104..dce09d4 100755 --- a/extras/ikev2setup.sh +++ b/extras/ikev2setup.sh @@ -153,7 +153,7 @@ check_container() { show_header() { cat <<'EOF' -IKEv2 Script Copyright (c) 2020-2021 Lin Song 29 Dec 2021 +IKEv2 Script Copyright (c) 2020-2022 Lin Song 4 Jan 2022 EOF } @@ -391,7 +391,7 @@ list_existing_clients() { [ "$max_len" -lt "16" ] && max_len=16 printf "%-${max_len}s %s\n" 'Client Name' 'Certificate Status' printf "%-${max_len}s %s\n" '------------' '-------------------' - printf '%s\n' "$client_names" | while read -r line; do + printf '%s\n' "$client_names" | LC_ALL=C sort | while read -r line; do printf "%-${max_len}s " "$line" client_status=$(certutil -V -u C -d sql:/etc/ipsec.d -n "$line" | grep -o -e ' valid' -e expired -e revoked | sed -e 's/^ //') [ -z "$client_status" ] && client_status=unknown @@ -643,7 +643,6 @@ confirm_setup_options() { cat <