Last active
February 4, 2016 03:34
-
-
Save bonelifer/8b8a8eaa4dbf845282d0 to your computer and use it in GitHub Desktop.
Automate adding User to passworded lighttpd protected directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
user=$1 | |
realm=$2 | |
pass=$3 | |
hash=`echo -n "$user:$realm:$pass" | md5sum | cut -b -32` | |
echo "$user:$realm:$hash" | |
echo "$user:$realm:$hash" >> /etc/lighttpd/.htpasswd/lighttpd-htdigest.user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment