add loging to db creation

This commit is contained in:
Usman Nasir
2021-03-25 23:39:03 +05:00
parent 0959ae4056
commit 9f1bb1cfe4
3 changed files with 26 additions and 20 deletions

View File

@@ -57,35 +57,34 @@ class ServerStatusUtil:
except:
pass
command = 'wget https://www.litespeedtech.com/packages/5.0/lsws-5.4.2-ent-x86_64-linux.tar.gz'
command = 'wget https://www.litespeedtech.com/packages/6.0/lsws-6.0-ent-x86_64-linux.tar.gz'
if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0
if os.path.exists('/usr/local/CyberCP/lsws-5.3.8/'):
shutil.rmtree('/usr/local/CyberCP/lsws-5.3.8')
if os.path.exists('/usr/local/CyberCP/lsws-6.0/'):
shutil.rmtree('/usr/local/CyberCP/lsws-6.0')
if os.path.exists('/usr/local/CyberCP/lsws-6.0/'):
shutil.rmtree('/usr/local/CyberCP/lsws-6.0/')
if os.path.exists('/usr/local/CyberCP/lsws-5.4.2/'):
shutil.rmtree('/usr/local/CyberCP/lsws-5.4.2/')
command = 'tar zxf lsws-5.4.2-ent-x86_64-linux.tar.gz -C /usr/local/CyberCP'
command = 'tar zxf lsws-6.0-ent-x86_64-linux.tar.gz -C /usr/local/CyberCP'
if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0
if licenseKey == 'trial':
command = 'wget -q --output-document=/usr/local/CyberCP/lsws-5.4.2/trial.key http://license.litespeedtech.com/reseller/trial.key'
command = 'wget -q --output-document=/usr/local/CyberCP/lsws-6.0/trial.key http://license.litespeedtech.com/reseller/trial.key'
if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0
else:
writeSerial = open('/usr/local/CyberCP/lsws-5.4.2/serial.no', 'w')
writeSerial = open('/usr/local/CyberCP/lsws-6.0/serial.no', 'w')
writeSerial.writelines(licenseKey)
writeSerial.close()
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/install.sh', '/usr/local/CyberCP/lsws-5.4.2/')
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/functions.sh', '/usr/local/CyberCP/lsws-5.4.2/')
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/install.sh', '/usr/local/CyberCP/lsws-6.0/')
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/functions.sh', '/usr/local/CyberCP/lsws-6.0/')
os.chdir('/usr/local/CyberCP/lsws-5.4.2/')
os.chdir('/usr/local/CyberCP/lsws-6.0/')
command = 'chmod +x install.sh'
if ServerStatusUtil.executioner(command, statusFile) == 0:
@@ -112,7 +111,7 @@ class ServerStatusUtil:
pass
try:
os.rmdir("/usr/local/CyberCP/lsws-5.4.2")
os.rmdir("/usr/local/CyberCP/lsws-6.0")
except:
pass