Core Module - Add htpasswd love

This commit is contained in:
Mike Reeves
2019-07-15 15:39:43 -04:00
parent 9ba5f67828
commit 186defe0e2
3 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
#!/bin/bash
USERNAME=$1
# Make sure a username is provided
[ $# -eq 0 ] && { echo "Usage: $0 username"; exit 1; }
# If the file is there already lets create it otherwise add the user
if [ ! -f /opt/so/conf/nginx/.htpasswd ]; then
# Create the password file
htpasswd -c /opt/so/conf/nginx/.htpasswd $USERNAME
else
htpasswd /opt/so/conf/nginx/.htpasswd $USERNAME
fi