diff --git a/install/install.py b/install/install.py index 7bb2b6975..c6462d140 100755 --- a/install/install.py +++ b/install/install.py @@ -1685,9 +1685,26 @@ imap_folder_list_limit = 0 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() + ### Check and remove OLS restart if lsws ent detected + + if not os.path.exists('/usr/local/lsws/bin/openlitespeed'): + + data = open(cronPath, 'r').readlines() + + writeToFile = open(cronPath, 'w') + + for items in data: + if items.find('-maxdepth 2 -type f -newer') > -1: + pass + else: + writeToFile.writelines(items) + + writeToFile.close() + if not os.path.exists(CentOSPath): command = 'chmod 600 %s' % (cronPath) preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 5e4425776..d60ddfca6 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -2406,6 +2406,23 @@ vmail writeToFile.write(content) writeToFile.close() + ### Check and remove OLS restart if lsws ent detected + + if not os.path.exists('/usr/local/lsws/bin/openlitespeed'): + + data = open(cronPath, 'r').readlines() + + writeToFile = open(cronPath, 'w') + + for items in data: + if items.find('-maxdepth 2 -type f -newer') > -1: + pass + else: + writeToFile.writelines(items) + + writeToFile.close() + + if not os.path.exists(CentOSPath): command = 'chmod 600 %s' % (cronPath) Upgrade.executioner(command, 0) diff --git a/serverStatus/serverStatusUtil.py b/serverStatus/serverStatusUtil.py index 83a18d9f3..ae8862793 100755 --- a/serverStatus/serverStatusUtil.py +++ b/serverStatus/serverStatusUtil.py @@ -348,6 +348,28 @@ class ServerStatusUtil: ProcessUtilities.stopLitespeed() ProcessUtilities.restartLitespeed() + ### Check and remove OLS restart if lsws ent detected + + CentOSPath = '/etc/redhat-release' + + if os.path.exists(CentOSPath): + cronPath = '/var/spool/cron/root' + else: + cronPath = '/var/spool/cron/crontabs/root' + + data = open(cronPath, 'r').readlines() + + writeToFile = open(cronPath, 'w') + + for items in data: + if items.find('-maxdepth 2 -type f -newer') > -1: + pass + else: + writeToFile.writelines(items) + + writeToFile.close() + + ### logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,"Successfully switched to LITESPEED ENTERPRISE WEB SERVER. [200]\n", 1)