From ef46cff27b400e734a4e444f119b633407ce9348 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 20 Mar 2020 23:22:56 +0500 Subject: [PATCH] check and install imunify during upgrade --- CLManager/CageFS.py | 10 ++++++++++ plogical/upgrade.py | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/CLManager/CageFS.py b/CLManager/CageFS.py index ca419d988..9c5b6c8e3 100644 --- a/CLManager/CageFS.py +++ b/CLManager/CageFS.py @@ -118,6 +118,16 @@ class CageFS: def submitinstallImunify(key): try: + imunifyKeyPath = '/home/cyberpanel/imunifyKeyPath' + + ## + + writeToFile = open(imunifyKeyPath, 'w') + writeToFile.write(key) + writeToFile.close() + + ## + mailUtilities.checkHome() statusFile = open(ServerStatusUtil.lswsInstallStatusPath, 'w') diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 1f136fa09..99cb2f093 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -2123,6 +2123,22 @@ vmail writeToFile.close() + @staticmethod + def checkImunify(): + + imunifyKeyPath = '/home/cyberpanel/imunifyKeyPath' + + if os.path.exists(imunifyKeyPath): + key = open(imunifyKeyPath, 'r').read().rstrip('\n') + + if not os.path.exists('i360deploy.sh'): + command = 'wget https://repo.imunify360.cloudlinux.com/defence360/i360deploy.sh' + Upgrade.executioner(command, command) + + command = 'bash i360deploy.sh --key %s --beta' % (key) + Upgrade.executioner(command, command) + + @staticmethod def upgrade(branch): @@ -2212,6 +2228,7 @@ vmail time.sleep(3) ## Upgrade version + Upgrade.checkImunify() Upgrade.fixPermissions() Upgrade.upgradeVersion() Upgrade.UpdateMaxSSLCons()