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 8e83f51 commit 1cbd84b
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions install/installCyberPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ class InstallCyberPanel:
mysqlPassword = ""
CloudLinux8 = 0

@staticmethod
def ISARM():

try:
command = 'uname -a'
result = subprocess.run(command, capture_output=True, text=True, shell=True)

if 'aarch64' in result.stdout:
return True
else:
return False
except:
return False

@staticmethod
def OSFlags():
if os.path.exists("/etc/redhat-release"):
Expand Down Expand Up @@ -102,26 +116,34 @@ def installLiteSpeed(self):
except:
pass

command = 'wget https://www.litespeedtech.com/packages/6.0/lsws-6.0-ent-x86_64-linux.tar.gz'
if InstallCyberPanel.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'

install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)

command = 'tar zxf lsws-6.0-ent-x86_64-linux.tar.gz'
if InstallCyberPanel.ISARM():
command = 'tar zxf lsws-6.2-ent-aarch64-linux.tar.gz'
else:
command = 'tar zxf lsws-6.2-ent-x86_64-linux.tar.gz'

install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)

if str.lower(self.serial) == 'trial':
command = 'wget -q --output-document=lsws-6.0/trial.key http://license.litespeedtech.com/reseller/trial.key'
command = 'wget -q --output-document=lsws-6.2/trial.key http://license.litespeedtech.com/reseller/trial.key'
if self.serial == '1111-2222-3333-4444':
command = 'wget -q --output-document=/root/cyberpanel/install/lsws-6.0/trial.key http://license.litespeedtech.com/reseller/trial.key'
command = 'wget -q --output-document=/root/cyberpanel/install/lsws-6.2/trial.key http://license.litespeedtech.com/reseller/trial.key'
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
else:
writeSerial = open('lsws-6.0/serial.no', 'w')
writeSerial = open('lsws-6.2/serial.no', 'w')
writeSerial.writelines(self.serial)
writeSerial.close()

shutil.copy('litespeed/install.sh', 'lsws-6.0/')
shutil.copy('litespeed/functions.sh', 'lsws-6.0/')
shutil.copy('litespeed/install.sh', 'lsws-6.2/')
shutil.copy('litespeed/functions.sh', 'lsws-6.2/')

os.chdir('lsws-6.0')
os.chdir('lsws-6.2')

command = 'chmod +x install.sh'
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
Expand Down

0 comments on commit 1cbd84b

Please sign in to comment.