missing htpasswd-flag "-b" when using password from cli

This commit is contained in:
teuto.net Netzdienste GmbH 2018-08-21 13:28:57 +02:00 committed by GitHub
parent a87d968870
commit 2996d50b40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,7 @@
#!/bin/sh #!/bin/sh
HTPASSWD="htpasswd"
if [ -z "$1" ]; then if [ -z "$1" ]; then
echo "create_user [username]" echo "create_user [username]"
echo "or" echo "or"
@ -7,4 +9,10 @@ if [ -z "$1" ]; then
exit 1 exit 1
fi fi
htpasswd -s $PASSWORD_FILE $1 $2 if [ ! -z "$2" ]; then
HTPASSWD="$HTPASSWD -b"
fi
HTPASSWD="$HTPASSWD -s $PASSWORD_FILE $1 $2"
$HTPASSWD