add manage-http-challenge-file function

This commit is contained in:
Nicolas Roman 2019-06-07 14:10:07 +02:00
parent 320a229d4f
commit b25639c3aa

View file

@ -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";