aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Eriksen <d@ennis.no>2021-03-31 14:32:18 +0200
committerDennis Eriksen <d@ennis.no>2021-03-31 14:32:18 +0200
commitdf9c02be6852f44183a6364859bc4f30497860df (patch)
treec19786fd9bc84986bf174bf5ff3aff72cfb6d980
parentremoving a not very tasteful debugline (diff)
downloadhtmpasswd-df9c02be6852f44183a6364859bc4f30497860df.tar.gz
add configfile
Diffstat (limited to '')
-rwxr-xr-xhtmpasswd15
1 files 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