From d382350bde95bd3339c92f815729ce4894b54947 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Sun, 13 Jan 2019 11:51:47 -0600 Subject: [PATCH] Improve VPN users - Check VPN users for duplicates in the helper script --- extras/update_vpn_users.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extras/update_vpn_users.sh b/extras/update_vpn_users.sh index 49624eb..0df05da 100644 --- a/extras/update_vpn_users.sh +++ b/extras/update_vpn_users.sh @@ -82,6 +82,10 @@ case "$VPN_USERS $VPN_PASSWORDS" in ;; esac +if printf '%s' "$VPN_USERS" | tr ' ' '\n' | sort | uniq -c | grep -qv '^ *1 '; then + exiterr "VPN usernames must not contain duplicates." +fi + clear cat <<'EOF'