From 2e29fbbeacc6a0f7811289680af1bb5ee4a0f095 Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Fri, 15 Oct 2021 00:43:03 -0400 Subject: [PATCH] only touch .htpasswd file if it's missing the touch command is simply for creating an empty file, to enable storing the first password hash --- kaya | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kaya b/kaya index b2966a8..a1e0ffb 100755 --- a/kaya +++ b/kaya @@ -107,7 +107,10 @@ create-backup-dir() { # check / create the hashed password in .htpasswd update-htpasswd-file() { - touch "${htpasswd_file}"; chmod 600 "${htpasswd_file}" + if [[ ! -e $htpasswd_file ]] ; then + touch "${htpasswd_file}" + fi + chmod 600 "${htpasswd_file}" # check to see if the password is already there and correct # otherwise, update it -- 2.25.1