From b25639c3aaab010392ceefd2cc5a90e8fa9aa2a6 Mon Sep 17 00:00:00 2001 From: Nicolas Roman Date: Fri, 7 Jun 2019 14:10:07 +0200 Subject: [PATCH] add manage-http-challenge-file function --- scripts/web-add.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scripts/web-add.sh b/scripts/web-add.sh index b4ca350..27b874c 100755 --- a/scripts/web-add.sh +++ b/scripts/web-add.sh @@ -156,6 +156,11 @@ setphpversion LOGIN VERSION setquota LOGIN QUOTA_SOFT:QUOTA_HARD Change quotas for LOGIN + +manage-http-challenge-file [CREATE | DELETE] + + Create or delete a dummy file for the Let's Encrypt HTTP challenge + The default directory is /var/lib/letsencrypt/.well-known/ EOT } @@ -845,6 +850,9 @@ arg_processing() { setquota) op_setquota "$@" ;; + manage-http-challenge-file) + op_managehttpchallengefile "$@" + ;; *) usage ;; @@ -852,6 +860,22 @@ arg_processing() { fi } +op_managehttpchallengefile() { + if [ $# -eq 1 ]; then + file="/var/lib/letsencrypt/.well-known/123456789" + action=${1}; + + if [ "$action" = "create" ]; then + touch "$file" + chmod 755 "$file" + elif [ "$action" = "delete" ]; then + rm "$file" + else usage + fi + else usage + fi +} + op_listvhost() { if [ $# -eq 1 ]; then configlist="$VHOST_PATH/${1}.conf";