diff --git a/cli/cliParser.py b/cli/cliParser.py index 00c7cb7d7..5f968afc3 100755 --- a/cli/cliParser.py +++ b/cli/cliParser.py @@ -63,6 +63,7 @@ class cliParser: parser.add_argument('--selectedACL', help='Select ACL while creating user.') parser.add_argument('--securityLevel', help='Set security level while creating user.') parser.add_argument('--state', help='State value used in user suspension.') + parser.add_argument('--licenseKey', help='LSWS License Key') ### WP Install diff --git a/cli/cyberPanel.py b/cli/cyberPanel.py index f17755e51..734136e70 100755 --- a/cli/cyberPanel.py +++ b/cli/cyberPanel.py @@ -1582,6 +1582,18 @@ def main(): wm = WebsiteManager() wm.installJoomla(1, data) + elif args.function == "switchTOLSWS": + + completeCommandExample = 'cyberpanel switchTOLSWS --licenseKey -1: + command = "sudo rm -f " + ServerStatusUtil.lswsInstallStatusPath + ProcessUtilities.popenExecutioner(command) + data_ret = {'status': 1, 'abort': 1, 'requestStatus': output, 'installed': 0} + print(str(data_ret)) + return 0 + elif output.find('[200]') > -1: + command = "sudo rm -f " + ServerStatusUtil.lswsInstallStatusPath + ProcessUtilities.popenExecutioner(command) + data_ret = {'status': 1, 'abort': 1, 'requestStatus': 'Successfully converted.', 'installed': 1} + print(str(data_ret)) + return 1 + else: + data_ret = {'status': 1, 'abort': 0, 'requestStatus': output, 'installed': 0} + #print(output) + time.sleep(2) + + except BaseException as msg: + logging.CyberCPLogFileWriter.writeToFile(str(msg)) + + def main(): parser = argparse.ArgumentParser(description='Server Status Util.')