Check password length

This commit is contained in:
Bob Mottram 2015-11-21 14:11:34 +00:00
parent 74101c3df1
commit df1c11802d
1 changed files with 7 additions and 0 deletions

View File

@ -55,6 +55,9 @@ CONFIG_FILENAME=
DEFAULT_DOMAIN_NAME="${PROJECT_NAME}.local" DEFAULT_DOMAIN_NAME="${PROJECT_NAME}.local"
# Minimum number of characters in a password
MINIMUM_PASSWORD_LENGTH=10
while [[ $# > 1 ]] while [[ $# > 1 ]]
do do
key="$1" key="$1"
@ -83,6 +86,10 @@ case $key in
-p|--password) -p|--password)
shift shift
PASSWORD="$1" PASSWORD="$1"
if [ ${#PASSWORD} -lt $MINIMUM_PASSWORD_LENGTH ]; then
echo "Your password chould contain at least ${MINIMUM_PASSWORD_LENGTH} characters"
exit 3628
fi
;; ;;
-s|--size) -s|--size)
shift shift