diff --git a/examples/simple/htaccess b/examples/simple/htpasswd similarity index 64% rename from examples/simple/htaccess rename to examples/simple/htpasswd index 326cc19..d479313 100644 --- a/examples/simple/htaccess +++ b/examples/simple/htpasswd @@ -1,2 +1,3 @@ a:{SHA}qZk+NkcGgWq6PiVxeFDCbJzQ2J0= fb:{SHA}MW7uIgOKtXmGLGk4ZKZl/cYBAjw= +DLKFj:{SHA}qZk+NkcGgWq6PiVxeFDCbJzQ2J0= diff --git a/examples/simple/job_add_user.sh b/examples/simple/job_add_user.sh index e3114ee..4e48b6e 100755 --- a/examples/simple/job_add_user.sh +++ b/examples/simple/job_add_user.sh @@ -1,12 +1,16 @@ #!/bin/sh -HTACCESS=htaccess +HTPASSWD=htpasswd err() { echo $* >&2 exit 1 } +echo $username +echo $password1 +echo $password2 + if [ -z "$password1" ]; then err "Empty password specified" fi @@ -14,13 +18,13 @@ if [ "$password1" != "$password2" ]; then err "Passwords do not match." fi -if [ $(egrep "^$username:" $HTACCESS) ]; then +if [ $(egrep "^$username:" $HTPASSWD) ]; then UPDATE=1 else UPDATE=0 fi -htpasswd -s -b $HTACCESS $username $password1 || exit $? +htpasswd -s -b $HTPASSWD $username $password1 || exit $? if [ "$UPDATE" -eq 1 ]; then echo "User password updated"