mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 10:50:16 +00:00
fix(scripts): prevent adding wireguard 'usernames' longer than 15 characters, fixes issue #1816
This commit is contained in:
parent
f732de20de
commit
68520aa7b2
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue