dotfiles/bin/htpasswd-entry

9 lines
158 B
Bash
Executable File

#!/bin/sh
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: $0 <username> <password>"
exit 1
fi
HASHED=$(openssl passwd -apr1 "$2")
echo "$1:$HASHED"