force passive ip on ubuntu

This commit is contained in:
Usman Nasir
2020-02-03 11:45:34 +05:00
parent 645d5d1552
commit 0ef0b5139c
2 changed files with 9 additions and 3 deletions

View File

@@ -2310,9 +2310,9 @@ def main():
import installCyberPanel
if ent == 0:
installCyberPanel.Main(cwd, mysql, distro, ent, None, port, args.ftp, args.powerdns)
installCyberPanel.Main(cwd, mysql, distro, ent, None, port, args.ftp, args.powerdns, args.publicip)
else:
installCyberPanel.Main(cwd, mysql, distro, ent, serial, port, args.ftp, args.powerdns)
installCyberPanel.Main(cwd, mysql, distro, ent, serial, port, args.ftp, args.powerdns, args.publicip)
checks.setupPHPAndComposer()
checks.fix_selinux_issue()

View File

@@ -18,7 +18,7 @@ class InstallCyberPanel:
mysql_Root_password = ""
mysqlPassword = ""
def __init__(self, rootPath, cwd, distro, ent, serial = None, port = None, ftp = None, dns = None):
def __init__(self, rootPath, cwd, distro, ent, serial = None, port = None, ftp = None, dns = None, publicip = None):
self.server_root_path = rootPath
self.cwd = cwd
self.distro = distro
@@ -27,6 +27,7 @@ class InstallCyberPanel:
self.port = port
self.ftp = None
self.dns = dns
self.publicip = publicip
@staticmethod
def stdOut(message, log=0, exit=0, code=os.EX_OK):
@@ -439,6 +440,11 @@ class InstallCyberPanel:
command = 'echo 1 > /etc/pure-ftpd/conf/TLS'
subprocess.call(command, shell=True)
command = 'echo %s > /etc/pure-ftpd/conf/ForcePassiveIP' % (self.publicip)
subprocess.call(command, shell=True)
command = 'systemctl restart pure-ftpd-mysql.service'
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)