bug fix: install process

This commit is contained in:
Usman Nasir
2019-09-18 15:06:58 +05:00
parent 9a78d85e2f
commit d165e1d1cf
3 changed files with 15 additions and 13 deletions

View File

@@ -145,15 +145,9 @@ class ServerStatusUtil:
if os.path.exists('/usr/local/lsws'):
shutil.rmtree('/usr/local/lsws')
command = 'tar -zxvf /usr/local/olsBackup.tar.gz -C /usr/local/'
command = 'mv /usr/local/lsws.bak /usr/local/lsws'
ServerStatusUtil.executioner(command, FNULL)
command = 'mv /usr/local/usr/local/lsws /usr/local'
ServerStatusUtil.executioner(command, FNULL)
if os.path.exists('/usr/local/usr'):
shutil.rmtree('/usr/local/usr')
@staticmethod
def createWebsite(website):
try:
@@ -285,9 +279,16 @@ class ServerStatusUtil:
ProcessUtilities.killLiteSpeed()
if os.path.exists('/usr/local/lsws'):
command = 'tar -zcvf /usr/local/olsBackup.tar.gz /usr/local/lsws'
command = 'mkdir /usr/local/lsws.bak'
if ServerStatusUtil.executioner(command, FNULL) == 0:
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Failed to create backup of current LSWS. [404]", 1)
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Failed to create backup of current LSWS. [mkdir] [404]", 1)
ServerStatusUtil.recover()
return 0
command = 'cp -R /usr/local/lsws/* /usr/local/lsws.bak/'
if ServerStatusUtil.executioner(command, FNULL) == 0:
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
"Failed to create backup of current LSWS. [cp][404]", 1)
ServerStatusUtil.recover()
return 0