Skip to content
Snippets Groups Projects
Commit 2fd7f385 authored by Bob Mottram's avatar Bob Mottram
Browse files

Check that the maximum number of users is not exceeded

parent 0b1bdd6f
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,15 @@ if [ ! -f "$COMPLETION_FILE" ]; then
exit 3
fi
# shellcheck disable=SC2126
no_of_users=$(find /home/ -maxdepth 1 -type d | grep -Fxv "/home/go" | grep -Fxv "/home/gogs" | grep -Fxv "/home/pihole" | grep -Fxv "/home/" | wc -l)
# shellcheck disable=SC2086
if [ $no_of_users -ge 10 ]; then
echo $"Maximum number of users reached"
exit 4
fi
# Minimum number of characters in a password
MINIMUM_PASSWORD_LENGTH=$(grep 'MINIMUM_PASSWORD_LENGTH=' "/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-passwords" | head -n 1 | awk -F '=' '{print $2}')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment