centralized execution ph5

This commit is contained in:
usmannasir
2019-04-01 15:19:54 +05:00
parent e12b412a42
commit 04e07905f2
8 changed files with 85 additions and 81 deletions

View File

@@ -37,6 +37,8 @@ class ServerStatusUtil:
def installLiteSpeed(licenseKey, statusFile):
try:
logging.CyberCPLogFileWriter.writeToFile(os.environ.get('TERM'))
cwd = os.getcwd()
try:
@@ -61,18 +63,18 @@ class ServerStatusUtil:
if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0
command = 'tar zxf lsws-5.3.5-ent-x86_64-linux.tar.gz'
command = 'tar zxf lsws-5.3.5-ent-x86_64-linux.tar.gz -C /usr/local/CyberCP'
if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0
writeSerial = open('lsws-5.3.5/serial.no', 'w')
writeSerial = open('/usr/local/CyberCP/lsws-5.3.5/serial.no', 'w')
writeSerial.writelines(licenseKey)
writeSerial.close()
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/install.sh', 'lsws-5.3.5/')
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/functions.sh', 'lsws-5.3.5/')
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/install.sh', '/usr/local/CyberCP/lsws-5.3.5/')
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/functions.sh', '/usr/local/CyberCP/lsws-5.3.5/')
os.chdir('lsws-5.3.5')
os.chdir('/usr/local/CyberCP/lsws-5.3.5/')
command = 'chmod +x install.sh'
if ServerStatusUtil.executioner(command, statusFile) == 0:
@@ -98,6 +100,11 @@ class ServerStatusUtil:
except:
pass
try:
os.rmdir("/usr/local/CyberCP/lsws-5.3.5")
except:
pass
return 1
except BaseException, msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg))
@@ -258,6 +265,9 @@ class ServerStatusUtil:
@staticmethod
def switchTOLSWS(licenseKey):
try:
os.environ['TERM'] = "xterm-256color"
statusFile = open(ServerStatusUtil.lswsInstallStatusPath, 'w')
FNULL = open(os.devnull, 'w')