Use a different method for unattended installs

This commit is contained in:
rperper
2018-10-30 17:33:43 -04:00
parent 66ab8b413c
commit 3cb1049840
2 changed files with 14 additions and 5 deletions

View File

@@ -1179,11 +1179,17 @@ class preFlightsChecks:
if self.distro == centos: if self.distro == centos:
command = 'yum install -y http://mirror.ghettoforge.org/distributions/gf/el/7/plus/x86_64//postfix3-3.2.4-1.gf.el7.x86_64.rpm' command = 'yum install -y http://mirror.ghettoforge.org/distributions/gf/el/7/plus/x86_64//postfix3-3.2.4-1.gf.el7.x86_64.rpm'
else: else:
command = 'debconf-set-selections <<< "postfix postfix/mailname string ' + str(socket.getfqdn()) + '"' command = 'apt-get -y debconf-utils'
subprocess.call(shlex.split(command), shell=True) subprocess.call(shlex.split(command))
command = 'debconf-set-selections <<< "postfix postfix/main_mailer_type string \'Internet Site\'"' file_name = self.cwd + '/pf.unattend.text'
subprocess.call(shlex.split(command), shell=True) pf = open(file_name, 'w')
pf.write('postfix postfix/mailname string ' + str(socket.getfqdn() + '\n'))
pf.write('postfix postfix/main_mailer_type string "Internet Site"\n')
pf.close()
command = 'debconf-set-selections ' + file_name
subprocess.call(shlex.split(command))
command = 'apt-get -y install postfix' command = 'apt-get -y install postfix'
# os.remove(file_name)
cmd = shlex.split(command) cmd = shlex.split(command)

View File

@@ -970,7 +970,10 @@ class InstallCyberPanel:
InstallCyberPanel.stdOut("Configuring PowerDNS..") InstallCyberPanel.stdOut("Configuring PowerDNS..")
os.chdir(self.cwd) os.chdir(self.cwd)
dnsPath = "/etc/pdns/pdns.conf" if self.distro == centos:
dnsPath = "/etc/pdns/pdns.conf"
else:
dnsPath = "/etc/powerdns/pdns.conf"
if os.path.exists(dnsPath): if os.path.exists(dnsPath):
os.remove(dnsPath) os.remove(dnsPath)