Skip to content

Commit

Permalink
lsws conversion support for arm: ref https://app.clickup.com/t/86enj7r72
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Jan 30, 2024
1 parent 874cdfd commit 8e83f51
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
4 changes: 2 additions & 2 deletions plogical/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
# imap_port = 993
#
# # User credentials
#
#
# email_address = ''
# password = ''
#
# # Connect to the IMAP server
# mail = imaplib.IMAP4_SSL(imap_server, imap_port)
Expand Down
30 changes: 20 additions & 10 deletions serverStatus/serverStatusUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,34 +67,44 @@ def installLiteSpeed(licenseKey, statusFile):
except:
pass

command = 'wget https://www.litespeedtech.com/packages/6.0/lsws-6.0-ent-x86_64-linux.tar.gz'
from plogical.acl import ACLManager

if ACLManager.ISARM():
command = 'wget https://www.litespeedtech.com/packages/6.0/lsws-6.2-ent-aarch64-linux.tar.gz'
else:

command = 'wget https://www.litespeedtech.com/packages/6.0/lsws-6.2-ent-x86_64-linux.tar.gz'

if ServerStatusUtil.executioner(command, statusFile) == 0:
return 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-6.0/'):
shutil.rmtree('/usr/local/CyberCP/lsws-6.0/')
if os.path.exists('/usr/local/CyberCP/lsws-6.2/'):
shutil.rmtree('/usr/local/CyberCP/lsws-6.2/')

if ACLManager.ISARM():
command = 'tar zxf lsws-6.2-ent-aarch64-linux.tar.gz -C /usr/local/CyberCP'
else:
command = 'tar zxf lsws-6.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-6.0/trial.key http://license.litespeedtech.com/reseller/trial.key'
command = 'wget -q --output-document=/usr/local/CyberCP/lsws-6.2/trial.key http://license.litespeedtech.com/reseller/trial.key'
if ServerStatusUtil.executioner(command, statusFile) == 0:
return 0
else:
writeSerial = open('/usr/local/CyberCP/lsws-6.0/serial.no', 'w')
writeSerial = open('/usr/local/CyberCP/lsws-6.2/serial.no', 'w')
writeSerial.writelines(licenseKey)
writeSerial.close()

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/')
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/install.sh', '/usr/local/CyberCP/lsws-6.2/')
shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/functions.sh', '/usr/local/CyberCP/lsws-6.2/')

os.chdir('/usr/local/CyberCP/lsws-6.0/')
os.chdir('/usr/local/CyberCP/lsws-6.2/')

command = 'chmod +x install.sh'
if ServerStatusUtil.executioner(command, statusFile) == 0:
Expand All @@ -121,7 +131,7 @@ def installLiteSpeed(licenseKey, statusFile):
pass

try:
os.rmdir("/usr/local/CyberCP/lsws-6.0")
os.rmdir("/usr/local/CyberCP/lsws-6.2")
except:
pass

Expand Down

0 comments on commit 8e83f51

Please sign in to comment.