mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
18 lines
376 B
Bash
18 lines
376 B
Bash
#!/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
|