fix(scripts): prevent adding wireguard 'usernames' longer than 15 characters, fixes issue #1816

This commit is contained in:
Orazio 2024-04-13 15:54:01 +02:00
parent f732de20de
commit 68520aa7b2

View file

@ -52,6 +52,9 @@ checkName() {
elif [[ "${CLIENT_NAME::1}" == "." ]]; then elif [[ "${CLIENT_NAME::1}" == "." ]]; then
err "Names cannot start with a . (dot)." err "Names cannot start with a . (dot)."
exit 1 exit 1
elif [[ "${#CLIENT_NAME}" -gt 15 ]]; then
err "::: Names cannot be longer than 15 characters."
exit 1
elif [[ -z "${CLIENT_NAME}" ]]; then elif [[ -z "${CLIENT_NAME}" ]]; then
err "::: You cannot leave the name blank." err "::: You cannot leave the name blank."
exit 1 exit 1