diff --git a/CLScript/CLMain.py b/CLScript/CLMain.py index 7b30f40fb..480e7c325 100644 --- a/CLScript/CLMain.py +++ b/CLScript/CLMain.py @@ -3,9 +3,9 @@ import json class CLMain(): def __init__(self): self.path = '/usr/local/CyberCP/version.txt' - versionInfo = json.loads(open(self.path, 'r').read()) - self.version = versionInfo['version'] - self.build = versionInfo['build'] + #versionInfo = json.loads(open(self.path, 'r').read()) + self.version = '1.9' + self.build = '2' ipFile = "/etc/cyberpanel/machineIP" f = open(ipFile) diff --git a/install/install.py b/install/install.py index 204190f1a..ae244e460 100755 --- a/install/install.py +++ b/install/install.py @@ -648,6 +648,15 @@ class preFlightsChecks: command = 'chmod +x /usr/local/CyberCP/CLManager/CLPackages.py' 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): self.stdOut("Install unzip") try: @@ -2123,6 +2132,38 @@ milter_default_action = accept except: 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): command = 'wget -O - https://get.acme.sh | sh' subprocess.call(command, shell=True) @@ -2276,7 +2317,7 @@ def main(): else: preFlightsChecks.stdOut("Pure-FTPD will be installed and enabled.") checks.enableDisableFTP('On', distro) - + checks.installCLScripts() logging.InstallLog.writeToFile("CyberPanel installation successfully completed!") diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 844614802..5f3cde36e 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1723,6 +1723,14 @@ CSRF_COOKIE_SECURE = True command = 'chmod +x /usr/local/CyberCP/CLManager/CLPackages.py' 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.") except BaseException as msg: @@ -2048,6 +2056,38 @@ failovermethod=priority command = "sed -i 's|200|10000|g' /usr/local/lsws/conf/httpd_config.xml" 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 @@ -2167,6 +2207,7 @@ failovermethod=priority command = 'systemctl start cpssh' Upgrade.executioner(command, 'fix csf if there', 0) Upgrade.AutoUpgradeAcme() + Upgrade.installCLScripts() Upgrade.stdOut("Upgrade Completed.")