Check if password was given

htpasswd requiers `-b` to accept passwords from commandline.
This commit is contained in:
Aleks 2019-08-18 10:56:40 +02:00 committed by GitHub
parent a87d968870
commit c65d4735ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,4 +7,8 @@ if [ -z "$1" ]; then
exit 1 exit 1
fi fi
htpasswd -s $PASSWORD_FILE $1 $2 if [ -z $2 ]; then
htpasswd -s $PASSWORD_FILE $1
else
htpasswd -b -s $PASSWORD_FILE $1 $2
fi