mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 05:45:59 +01:00
centralized execution ph5
This commit is contained in:
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user