Usman Nasir
2021-05-08 14:37:31 +05:00
parent 402ecd7433
commit 618220f7fd
3 changed files with 56 additions and 0 deletions

View File

@@ -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)