From 71644a3a83c005e0ef4b8c6abef3fee8911c90b0 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 5 Jul 2020 16:15:08 +0500 Subject: [PATCH] allow to enter remote mysql default db --- install/installCyberPanel.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index c80de64e7..9c1526c19 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -308,26 +308,27 @@ class InstallCyberPanel: def startMariaDB(self): - ############## Start mariadb ###################### - if self.distro == cent8 or self.distro == ubuntu: - command = 'systemctl start mariadb' - else: - command = "systemctl start mysql" - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + if self.remotemysql == 'OFF': + ############## Start mariadb ###################### + if self.distro == cent8 or self.distro == ubuntu: + command = 'systemctl start mariadb' + else: + command = "systemctl start mysql" + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) - ############## Enable mariadb at system startup ###################### + ############## Enable mariadb at system startup ###################### - if os.path.exists('/etc/systemd/system/mysqld.service'): - os.remove('/etc/systemd/system/mysqld.service') - if os.path.exists('/etc/systemd/system/mariadb.service'): - os.remove('/etc/systemd/system/mariadb.service') + if os.path.exists('/etc/systemd/system/mysqld.service'): + os.remove('/etc/systemd/system/mysqld.service') + if os.path.exists('/etc/systemd/system/mariadb.service'): + os.remove('/etc/systemd/system/mariadb.service') - if self.distro == ubuntu: - command = "systemctl enable mariadb" - else: - command = "systemctl enable mariadb" + if self.distro == ubuntu: + command = "systemctl enable mariadb" + else: + command = "systemctl enable mariadb" - install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) def fixMariaDB(self): self.stdOut("Setup MariaDB so it can support Cyberpanel's needs")