diff --git a/wireguard-install.sh b/wireguard-install.sh index 59f7946..d450d99 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -212,9 +212,9 @@ function newClient() { echo "" echo "Tell me a name for the client." - echo "Use one word only, no special characters." + echo "The name must consist of alphanumeric character. It may also include an underscore or a dash." - until [[ ${CLIENT_NAME} =~ ^[a-zA-Z0-9_]+$ && ${CLIENT_EXISTS} == '0' ]]; do + until [[ ${CLIENT_NAME} =~ ^[a-zA-Z0-9_-]+$ && ${CLIENT_EXISTS} == '0' ]]; do read -rp "Client name: " -e CLIENT_NAME CLIENT_EXISTS=$(grep -c -E "^### Client ${CLIENT_NAME}\$" "/etc/wireguard/${SERVER_WG_NIC}.conf")