Disallow integers as client names to avoid ambiguity when removing a client by index.

This commit is contained in:
Orazio 2020-07-23 14:50:59 +02:00
parent 0200ce545c
commit 85478aaea0
2 changed files with 10 additions and 0 deletions

View file

@ -248,6 +248,11 @@ if [[ "${NAME}" =~ [^a-zA-Z0-9.@_-] ]]; then
exit 1 exit 1
fi fi
if [[ "${NAME}" =~ ^[0-9]+$ ]]; then
echo "Names cannot be integers."
exit 1
fi
if [[ -z "${NAME}" ]]; then if [[ -z "${NAME}" ]]; then
echo "You cannot leave the name blank." echo "You cannot leave the name blank."
exit 1 exit 1

View file

@ -64,6 +64,11 @@ if [[ "${CLIENT_NAME}" =~ [^a-zA-Z0-9.@_-] ]]; then
exit 1 exit 1
fi fi
if [[ "${CLIENT_NAME}" =~ ^[0-9]+$ ]]; then
echo "Names cannot be integers."
exit 1
fi
if [ -z "${CLIENT_NAME}" ]; then if [ -z "${CLIENT_NAME}" ]; then
echo "::: You cannot leave the name blank." echo "::: You cannot leave the name blank."
exit 1 exit 1