From 06774b846e4e4d30d4e52d76a1e76983f65f8973 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 20 Jan 2020 17:23:44 +0500 Subject: [PATCH 1/3] embed utils in cli --- cli/cyberPanel.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cli/cyberPanel.py b/cli/cyberPanel.py index 1d92f5042..920786950 100755 --- a/cli/cyberPanel.py +++ b/cli/cyberPanel.py @@ -1282,6 +1282,16 @@ def main(): cyberpanel.issueSelfSignedSSL(args.domainName) + elif args.function == 'utility': + command = '/usr/bin/cyberpanel_utility' + ProcessUtilities.executioner(command) + elif args.function == 'upgrade' or args.function == 'update': + command = '/usr/bin/cyberpanel_utility --upgrade' + ProcessUtilities.executioner(command) + elif args.function == 'utilhelp': + command = '/usr/bin/cyberpanel_utility --help' + ProcessUtilities.executioner(command) + if __name__ == "__main__": From ca9310bd128a65561dbe9d46b45effce32973acf Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 20 Jan 2020 17:26:27 +0500 Subject: [PATCH 2/3] fetch util script if not avail --- cli/cyberPanel.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cli/cyberPanel.py b/cli/cyberPanel.py index 920786950..638741aaf 100755 --- a/cli/cyberPanel.py +++ b/cli/cyberPanel.py @@ -1283,12 +1283,33 @@ def main(): cyberpanel.issueSelfSignedSSL(args.domainName) elif args.function == 'utility': + if not os.path.exists('/usr/bin/cyberpanel_utility'): + command = 'wget -q -O /usr/bin/cyberpanel_utility https://cyberpanel.sh/misc/cyberpanel_utility.sh' + ProcessUtilities.executioner(command) + + command = 'chmod 700 /usr/bin/cyberpanel_utility' + ProcessUtilities.executioner(command) + command = '/usr/bin/cyberpanel_utility' ProcessUtilities.executioner(command) elif args.function == 'upgrade' or args.function == 'update': + if not os.path.exists('/usr/bin/cyberpanel_utility'): + command = 'wget -q -O /usr/bin/cyberpanel_utility https://cyberpanel.sh/misc/cyberpanel_utility.sh' + ProcessUtilities.executioner(command) + + command = 'chmod 700 /usr/bin/cyberpanel_utility' + ProcessUtilities.executioner(command) + command = '/usr/bin/cyberpanel_utility --upgrade' ProcessUtilities.executioner(command) elif args.function == 'utilhelp': + if not os.path.exists('/usr/bin/cyberpanel_utility'): + command = 'wget -q -O /usr/bin/cyberpanel_utility https://cyberpanel.sh/misc/cyberpanel_utility.sh' + ProcessUtilities.executioner(command) + + command = 'chmod 700 /usr/bin/cyberpanel_utility' + ProcessUtilities.executioner(command) + command = '/usr/bin/cyberpanel_utility --help' ProcessUtilities.executioner(command) From 3ba3ae74b3e6fe11e0d41937e39c75bfdf3becad Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 20 Jan 2020 17:29:08 +0500 Subject: [PATCH 3/3] updated help command --- cli/cyberPanel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/cyberPanel.py b/cli/cyberPanel.py index 638741aaf..8b0c58018 100755 --- a/cli/cyberPanel.py +++ b/cli/cyberPanel.py @@ -1302,7 +1302,7 @@ def main(): command = '/usr/bin/cyberpanel_utility --upgrade' ProcessUtilities.executioner(command) - elif args.function == 'utilhelp': + elif args.function == 'help': if not os.path.exists('/usr/bin/cyberpanel_utility'): command = 'wget -q -O /usr/bin/cyberpanel_utility https://cyberpanel.sh/misc/cyberpanel_utility.sh' ProcessUtilities.executioner(command)