diff --git a/cli/cliParser.py b/cli/cliParser.py index 00c7cb7d7..bd7ef4231 100755 --- a/cli/cliParser.py +++ b/cli/cliParser.py @@ -70,4 +70,9 @@ class cliParser: parser.add_argument('--siteTitle', help='Site Title for application installers.') parser.add_argument('--path', help='Path for application installers.') + ### Convert to LSWS Ent via cli + + parser.add_argument('--licenseKey', help='LiteSpeed Enterprise License key') + + return parser.parse_args() 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) + + except BaseException as msg: + logging.CyberCPLogFileWriter.writeToFile(str(msg)) + def main(): parser = argparse.ArgumentParser(description='Server Status Util.')