From cf74343f8eb51e47e0540f3631c1dbd974a1cc72 Mon Sep 17 00:00:00 2001 From: Muttahir Aon Syed Date: Thu, 27 Aug 2020 00:20:54 +0500 Subject: [PATCH] OLS/LS restart on htaccess change Ref: https://feedback.cyberpanel.net/b/requests/p/automatic-restart-of-openlitespeed-server-after-any-change-in-htaccess --- install/install.py | 1 + plogical/upgrade.py | 1 + 2 files changed, 2 insertions(+) diff --git a/install/install.py b/install/install.py index d8b3fe347..45db696e5 100755 --- a/install/install.py +++ b/install/install.py @@ -1712,6 +1712,7 @@ imap_folder_list_limit = 0 7 0 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null 0 12 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py Daily 0 0 * * 0 /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py Weekly +*/3 * * * * if ! find /home/*/public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then /usr/local/lsws/bin/lswsctrl restart; fi """ cronFile.write(content) cronFile.close() diff --git a/plogical/upgrade.py b/plogical/upgrade.py index c3dc6ebd7..bd192e63b 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -2170,6 +2170,7 @@ vmail 0 2 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/upgradeCritical.py >/dev/null 2>&1 0 2 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/renew.py >/dev/null 2>&1 7 0 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null +*/3 * * * * if ! find /home/*/public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then /usr/local/lsws/bin/lswsctrl restart; fi """ writeToFile = open(cronPath, 'w')