From 36093c985be35a932b661171c74d391e40633c88 Mon Sep 17 00:00:00 2001 From: Stefan Kuhn Date: Tue, 5 Jan 2021 14:36:22 +0100 Subject: [PATCH] Make hook.sh executable and check if nginx is installed (#3) Check if nginx is installed --- hook.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 hook.sh diff --git a/hook.sh b/hook.sh old mode 100644 new mode 100755 index b13533a..3f01553 --- a/hook.sh +++ b/hook.sh @@ -30,8 +30,10 @@ clean_challenge() { deploy_cert() { local DOMAIN="${1}" KEYFILE="${2}" CERTFILE="${3}" FULLCHAINFILE="${4}" CHAINFILE="${5}" - cp "${KEYFILE}" "${FULLCHAINFILE}" /etc/nginx/ssl/; chown -R root: /etc/nginx/ssl - systemctl reload nginx + if [[ -d /etc/nginx/ssl/ ]]; then + cp "${KEYFILE}" "${FULLCHAINFILE}" /etc/nginx/ssl/; chown -R root: /etc/nginx/ssl + systemctl reload nginx + fi } unchanged_cert() {