Files
rest-server/docker/create_user
Stefan Midjich 4f17744d6c Support passwords with spaces
You must quote $2 in order to support passwords with spaces.
2025-03-13 14:40:59 +01:00

17 lines
310 B
Bash
Executable File

#!/bin/sh
if [ -z "$1" ]; then
echo "create_user [username]"
echo "or"
echo "create_user [username] [password]"
exit 1
fi
if [ -z "$2" ]; then
# password from prompt
htpasswd -B $PASSWORD_FILE $1
else
# read password from command line
htpasswd -B -b $PASSWORD_FILE $1 "$2"
fi