fix(scripts): disallow using server's name as client name (#1791)

This commit is contained in:
Orazio 2023-12-13 18:09:55 +01:00 committed by GitHub
parent 701a817fed
commit a85d3752ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,6 +49,9 @@ checkName() {
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
elif [[ "${CLIENT_NAME}" == "server" ]]; then
err "Sorry, this is in use by the server and cannot be used by clients."
exit 1
elif [[ -f "configs/${CLIENT_NAME}.conf" ]]; then elif [[ -f "configs/${CLIENT_NAME}.conf" ]]; then
err "::: A client with this name already exists" err "::: A client with this name already exists"
exit 1 exit 1