mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 13:25:51 +01:00
CLScripts
This commit is contained in:
@@ -3,9 +3,9 @@ import json
|
|||||||
class CLMain():
|
class CLMain():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.path = '/usr/local/CyberCP/version.txt'
|
self.path = '/usr/local/CyberCP/version.txt'
|
||||||
versionInfo = json.loads(open(self.path, 'r').read())
|
#versionInfo = json.loads(open(self.path, 'r').read())
|
||||||
self.version = versionInfo['version']
|
self.version = '1.9'
|
||||||
self.build = versionInfo['build']
|
self.build = '2'
|
||||||
|
|
||||||
ipFile = "/etc/cyberpanel/machineIP"
|
ipFile = "/etc/cyberpanel/machineIP"
|
||||||
f = open(ipFile)
|
f = open(ipFile)
|
||||||
|
|||||||
@@ -648,6 +648,15 @@ class preFlightsChecks:
|
|||||||
command = 'chmod +x /usr/local/CyberCP/CLManager/CLPackages.py'
|
command = 'chmod +x /usr/local/CyberCP/CLManager/CLPackages.py'
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
|
|
||||||
|
clScripts = ['/usr/local/CyberCP/CLScript/panel_info.py', '/usr/local/CyberCP/CLScript/CloudLinuxPackages.py',
|
||||||
|
'/usr/local/CyberCP/CLScript/CloudLinuxUsers.py',
|
||||||
|
'/usr/local/CyberCP/CLScript/CloudLinuxDomains.py'
|
||||||
|
, '/usr/local/CyberCP/CLScript/CloudLinuxResellers.py', '/usr/local/CyberCP/CLScript/CloudLinuxAdmins.py']
|
||||||
|
|
||||||
|
for items in clScripts:
|
||||||
|
command = 'chmod +x %s' % (items)
|
||||||
|
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
|
|
||||||
def install_unzip(self):
|
def install_unzip(self):
|
||||||
self.stdOut("Install unzip")
|
self.stdOut("Install unzip")
|
||||||
try:
|
try:
|
||||||
@@ -2123,6 +2132,38 @@ milter_default_action = accept
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def installCLScripts(self):
|
||||||
|
try:
|
||||||
|
|
||||||
|
CentOSPath = '/etc/redhat-release'
|
||||||
|
|
||||||
|
if os.path.exists(CentOSPath):
|
||||||
|
command = 'mkdir -p /opt/cpvendor/etc/'
|
||||||
|
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
|
||||||
|
|
||||||
|
content = """[integration_scripts]
|
||||||
|
|
||||||
|
panel_info = /usr/local/CyberCP/CLScript/panel_info.py
|
||||||
|
packages = /usr/local/CyberCP/CLScript/CloudLinuxPackages.py
|
||||||
|
users = /usr/local/CyberCP/CLScript/CloudLinuxUsers.py
|
||||||
|
domains = /usr/local/CyberCP/CLScript/CloudLinuxDomains.py
|
||||||
|
resellers = /usr/local/CyberCP/CLScript/CloudLinuxResellers.py
|
||||||
|
admins = /usr/local/CyberCP/CLScript/CloudLinuxAdmins.py
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[lvemanager_config]
|
||||||
|
run_service = 1
|
||||||
|
service_port = 9000
|
||||||
|
"""
|
||||||
|
|
||||||
|
writeToFile = open('/opt/cpvendor/etc/integration.ini', 'w')
|
||||||
|
writeToFile.write(content)
|
||||||
|
writeToFile.close()
|
||||||
|
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def installAcme(self):
|
def installAcme(self):
|
||||||
command = 'wget -O - https://get.acme.sh | sh'
|
command = 'wget -O - https://get.acme.sh | sh'
|
||||||
subprocess.call(command, shell=True)
|
subprocess.call(command, shell=True)
|
||||||
@@ -2276,7 +2317,7 @@ def main():
|
|||||||
else:
|
else:
|
||||||
preFlightsChecks.stdOut("Pure-FTPD will be installed and enabled.")
|
preFlightsChecks.stdOut("Pure-FTPD will be installed and enabled.")
|
||||||
checks.enableDisableFTP('On', distro)
|
checks.enableDisableFTP('On', distro)
|
||||||
|
checks.installCLScripts()
|
||||||
logging.InstallLog.writeToFile("CyberPanel installation successfully completed!")
|
logging.InstallLog.writeToFile("CyberPanel installation successfully completed!")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1723,6 +1723,14 @@ CSRF_COOKIE_SECURE = True
|
|||||||
command = 'chmod +x /usr/local/CyberCP/CLManager/CLPackages.py'
|
command = 'chmod +x /usr/local/CyberCP/CLManager/CLPackages.py'
|
||||||
Upgrade.executioner(command, command, 0)
|
Upgrade.executioner(command, command, 0)
|
||||||
|
|
||||||
|
clScripts = ['/usr/local/CyberCP/CLScript/panel_info.py', '/usr/local/CyberCP/CLScript/CloudLinuxPackages.py',
|
||||||
|
'/usr/local/CyberCP/CLScript/CloudLinuxUsers.py', '/usr/local/CyberCP/CLScript/CloudLinuxDomains.py'
|
||||||
|
,'/usr/local/CyberCP/CLScript/CloudLinuxResellers.py', '/usr/local/CyberCP/CLScript/CloudLinuxAdmins.py']
|
||||||
|
|
||||||
|
for items in clScripts:
|
||||||
|
command = 'chmod +x %s' % (items)
|
||||||
|
Upgrade.executioner(command, 0)
|
||||||
|
|
||||||
Upgrade.stdOut("Permissions updated.")
|
Upgrade.stdOut("Permissions updated.")
|
||||||
|
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
@@ -2048,6 +2056,38 @@ failovermethod=priority
|
|||||||
command = "sed -i 's|<maxSSLConnections>200</maxSSLConnections>|<maxSSLConnections>10000</maxSSLConnections>|g' /usr/local/lsws/conf/httpd_config.xml"
|
command = "sed -i 's|<maxSSLConnections>200</maxSSLConnections>|<maxSSLConnections>10000</maxSSLConnections>|g' /usr/local/lsws/conf/httpd_config.xml"
|
||||||
Upgrade.executioner(command, 0)
|
Upgrade.executioner(command, 0)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def installCLScripts():
|
||||||
|
try:
|
||||||
|
|
||||||
|
CentOSPath = '/etc/redhat-release'
|
||||||
|
|
||||||
|
if os.path.exists(CentOSPath):
|
||||||
|
command = 'mkdir -p /opt/cpvendor/etc/'
|
||||||
|
Upgrade.executioner(command, 0)
|
||||||
|
|
||||||
|
content = """[integration_scripts]
|
||||||
|
|
||||||
|
panel_info = /usr/local/CyberCP/CLScript/panel_info.py
|
||||||
|
packages = /usr/local/CyberCP/CLScript/CloudLinuxPackages.py
|
||||||
|
users = /usr/local/CyberCP/CLScript/CloudLinuxUsers.py
|
||||||
|
domains = /usr/local/CyberCP/CLScript/CloudLinuxDomains.py
|
||||||
|
resellers = /usr/local/CyberCP/CLScript/CloudLinuxResellers.py
|
||||||
|
admins = /usr/local/CyberCP/CLScript/CloudLinuxAdmins.py
|
||||||
|
|
||||||
|
[lvemanager_config]
|
||||||
|
run_service = 1
|
||||||
|
service_port = 9000
|
||||||
|
"""
|
||||||
|
|
||||||
|
if not os.path.exists('/opt/cpvendor/etc/integration.ini'):
|
||||||
|
writeToFile = open('/opt/cpvendor/etc/integration.ini', 'w')
|
||||||
|
writeToFile.write(content)
|
||||||
|
writeToFile.close()
|
||||||
|
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -2167,6 +2207,7 @@ failovermethod=priority
|
|||||||
command = 'systemctl start cpssh'
|
command = 'systemctl start cpssh'
|
||||||
Upgrade.executioner(command, 'fix csf if there', 0)
|
Upgrade.executioner(command, 'fix csf if there', 0)
|
||||||
Upgrade.AutoUpgradeAcme()
|
Upgrade.AutoUpgradeAcme()
|
||||||
|
Upgrade.installCLScripts()
|
||||||
|
|
||||||
Upgrade.stdOut("Upgrade Completed.")
|
Upgrade.stdOut("Upgrade Completed.")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user