From 22e34a16a3317ef115d81ec03cc9565a1397c7e3 Mon Sep 17 00:00:00 2001
From: Jesse Norell <jesse@kci.net>
Date: Fri, 25 Jun 2021 10:46:36 -0600
Subject: [PATCH] custom letsencrypt renew hook

---
 server/scripts/letsencrypt_renew_hook.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/server/scripts/letsencrypt_renew_hook.sh b/server/scripts/letsencrypt_renew_hook.sh
index 53fc31befd..63100ed650 100644
--- a/server/scripts/letsencrypt_renew_hook.sh
+++ b/server/scripts/letsencrypt_renew_hook.sh
@@ -12,8 +12,12 @@
 
 ## If you need a custom hook file, create a file with the same name in
 ## /usr/local/ispconfig/server/conf-custom/scripts/
+##
+## End the file with 'return 124' to signal that this script should not terminate.
 if [ -e "/usr/local/ispconfig/server/conf-custom/scripts/letsencrypt_renew_hook.sh" ] ; then
-	. /usr/local/ispconfig/server/conf-custom/scripts/letsencrypt_renew_hook.sh && exit 0 || exit 1;
+        . /usr/local/ispconfig/server/conf-custom/scripts/letsencrypt_renew_hook.sh
+        ret=$?
+        if [ $ret != 124 ]; then exit $ret; fi
 fi
 
 hostname=$(hostname -f)
@@ -52,4 +56,4 @@ if [ -d "$lelive" ]; then
         if [ $(dpkg-query -W -f='${Status}' nginx 2>/dev/null | grep -c "ok installed") -eq 1 ]; then service nginx restart; fi
         if [ $(dpkg-query -W -f='${Status}' apache2 2>/dev/null | grep -c "ok installed") -eq 1 ]; then service apache2 restart; fi
     fi
-else echo `/bin/date` "Your Lets Encrypt SSL certs path for your ISPConfig server FQDN is missing.$line" >> /var/log/ispconfig/ispconfig.log; fi
\ No newline at end of file
+else echo `/bin/date` "Your Lets Encrypt SSL certs path for your ISPConfig server FQDN is missing.$line" >> /var/log/ispconfig/ispconfig.log; fi
-- 
GitLab