diff --git a/install/install.py b/install/install.py index 9f0bc3a77..41254f7ce 100755 --- a/install/install.py +++ b/install/install.py @@ -917,6 +917,32 @@ class preFlightsChecks: writeDataToFile.close() + + + if self.remotemysql == 'ON': + command = "sed -i 's|host=localhost|host=%s|g' %s" % (self.mysqlhost, davecotmysql) + preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + + command = "sed -i 's|port=3306|port=%s|g' %s" % (self.mysqlport, davecotmysql) + preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + + ## + + command = "sed -i 's|localhost|%s:%s|g' %s" % (self.mysqlhost, self.mysqlport, mysql_virtual_domains) + preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + + command = "sed -i 's|localhost|%s:%s|g' %s" % ( + self.mysqlhost, self.mysqlport, mysql_virtual_forwardings) + preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + + command = "sed -i 's|localhost|%s:%s|g' %s" % ( + self.mysqlhost, self.mysqlport, mysql_virtual_mailboxes) + preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + + command = "sed -i 's|localhost|%s:%s|g' %s" % ( + self.mysqlhost, self.mysqlport, mysql_virtual_email2email) + preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + logging.InstallLog.writeToFile("Authentication for Postfix and Dovecot set.") except BaseException as msg: diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 91e9204dd..4b777feaa 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -420,6 +420,18 @@ class InstallCyberPanel: writeDataToFile.close() + ftpConfPath = '/etc/pure-ftpd/pureftpd-mysql.conf' + + if self.remotemysql == 'ON': + command = "sed -i 's|localhost|%s|g' %s" % (self.mysqlhost, ftpConfPath) + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + + command = "sed -i 's|3306|%s|g' %s" % (self.mysqlport, ftpConfPath) + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + + command = "sed -i 's|MYSQLSocket /var/lib/mysql/mysql.sock||g' %s" % (ftpConfPath) + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + if self.distro == ubuntu: if os.path.exists('/etc/pure-ftpd/db/mysql.conf'): @@ -551,6 +563,14 @@ class InstallCyberPanel: writeDataToFile.close() + + if self.remotemysql == 'ON': + command = "sed -i 's|gmysql-host=127.0.0.1|gmysql-host=%s|g' %s" % (self.mysqlhost, dnsPath) + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + + command = "sed -i 's|gmysql-port=3306|gmysql-port=%s|g' %s" % (self.mysqlport, dnsPath) + install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) + InstallCyberPanel.stdOut("PowerDNS configured!", 1) except IOError as msg: diff --git a/install/mysqlUtilities.py b/install/mysqlUtilities.py index 580460b78..a1e3f95c3 100755 --- a/install/mysqlUtilities.py +++ b/install/mysqlUtilities.py @@ -60,6 +60,7 @@ class mysqlUtilities: dropDB = "GRANT ALL PRIVILEGES ON " + dbname + ".* TO '" + dbuser + "'@'%s'" % (publicip) else: dropDB = "GRANT ALL PRIVILEGES ON " + dbname + ".* TO '" + dbuser + "'@'localhost'" + command = initCommand + dropDB + '"' if install.preFlightsChecks.debug: