mirror of
https://github.com/angristan/wireguard-install.git
synced 2024-11-23 21:46:02 +03:00
fix: Approve CLIENT_NAME without checking config file
This commit is contained in:
parent
a01b3cf4dc
commit
f285af5743
@ -331,7 +331,10 @@ function newClient() {
|
||||
echo ""
|
||||
echo "The client name must consist of alphanumeric character(s). It may also include underscores or dashes and can't exceed 15 chars."
|
||||
|
||||
CLIENT_EXISTS=$(grep -c -E "^### Client ${CLIENT_NAME}\$" "/etc/wireguard/${SERVER_WG_NIC}.conf")
|
||||
if [[ ${APPROVE_INSTALL} == "y" ]]; then
|
||||
CLIENT_EXISTS="0"
|
||||
fi
|
||||
|
||||
until [[ ${CLIENT_NAME} =~ ^[a-zA-Z0-9_-]+$ && ${CLIENT_EXISTS} == '0' && ${#CLIENT_NAME} -lt 16 ]]; do
|
||||
read -rp "Client name: " -e CLIENT_NAME
|
||||
CLIENT_EXISTS=$(grep -c -E "^### Client ${CLIENT_NAME}\$" "/etc/wireguard/${SERVER_WG_NIC}.conf")
|
||||
|
Loading…
Reference in New Issue
Block a user