From df9c02be6852f44183a6364859bc4f30497860df Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Wed, 31 Mar 2021 14:32:18 +0200 Subject: add configfile --- htmpasswd | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/htmpasswd b/htmpasswd index ad289ea..6613b8a 100755 --- a/htmpasswd +++ b/htmpasswd @@ -39,20 +39,29 @@ set -o nounset # set -x if the DEBUG-environmental is true if ${DEBUG:-false}; then set -x; fi + +# Variables + # Directory where htpasswd-files are stored HTDIR=/etc/nginx/htpasswd # Spool-directory where temporary users are stored until they can be deleted SPOOLDIR=/var/spool/htmpasswd -# Temporary time, with minute precicion -# Must be valid with `date` -# Check by doing `date --date "$TIME"` +# Temporary time, with minute precicion. Must be valid with `date`. Check by doing `date --date "$TIME"` TIME="+1 day" +# Lengt of username USER_LENGTH=6 + +# Length of password PASS_LENGTH=6 +# Load config, if it exists +if [[ -r /etc/default/htmpasswd ]]; then + . /etc/default/htmpasswd +fi + die() { echo "$@" exit 1 -- cgit v1.2.3