add further error checking during upgrade

This commit is contained in:
Usman Nasir
2021-03-24 12:31:56 +05:00
parent 4d8a45158d
commit 1ca5b83122
3 changed files with 33 additions and 13 deletions

View File

@@ -53,6 +53,9 @@ class UpgradeCyberPanel:
command = 'cp -R /usr/local/CyberCP /usr/local/CyberCPBak'
Upgrade.executioner(command, command)
if not Upgrade.executioner(command, command, 1):
self.PostStatus('Failed to execute %s. [404]' % (command))
self.PostStatus('Upgrading/Downgrading to branch %s..,10' % (self.branch))
status, message = Upgrade.downloadAndUpgrade(None, self.branch)
@@ -80,7 +83,6 @@ class UpgradeCyberPanel:
self.PostStatus('Database updated.,55')
## Put function here to update custom ACLs
Upgrade.UpdateConfigOfCustomACL()
@@ -99,12 +101,14 @@ class UpgradeCyberPanel:
Upgrade.upgradeVersion()
Upgrade.UpdateMaxSSLCons()
command = 'systemctl restart lscpd'
if not Upgrade.executioner(command, command, 1):
self.PostStatus('Failed to execute %s. [404]' % (command))
self.PostStatus('CyberPanel Upgraded/Downgraded to %s. [200]' % (self.branch))
def main():
parser = argparse.ArgumentParser(description='CyberPanel Installer')
parser.add_argument('--branch', help='Branch to install.')