mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-10 15:26:13 +01:00
Fixed managePDNS: select pdns.conf path according to OS; removed unnecessary /32; Move temp file to pdns.conf
This commit is contained in:
@@ -22,7 +22,11 @@ class ServiceManager:
|
||||
|
||||
def managePDNS(self):
|
||||
type = self.extraArgs['type']
|
||||
|
||||
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||
path = '/etc/pdns/pdns.conf'
|
||||
else:
|
||||
path = '/etc/powerdns/pdns.conf'
|
||||
|
||||
data = ProcessUtilities.outputExecutioner('sudo cat ' + path).splitlines()
|
||||
#data = subprocess.check_output(shlex.split('sudo cat ' + path)).decode("utf-8").splitlines()
|
||||
@@ -35,6 +39,7 @@ class ServiceManager:
|
||||
ipStringNoSubnet = ''
|
||||
|
||||
for items in SlaveServers.objects.all():
|
||||
if items.slaveServerIP:
|
||||
ipsString = ipsString + '%s/32, ' % (items.slaveServerIP)
|
||||
ipStringNoSubnet = ipStringNoSubnet + '%s, ' % (items.slaveServerIP)
|
||||
|
||||
@@ -74,6 +79,9 @@ class ServiceManager:
|
||||
writeToFile.writelines('disable-axfr=no\n')
|
||||
writeToFile.writelines('master=yes\n')
|
||||
writeToFile.close()
|
||||
|
||||
command = 'sudo mv ' + tempPath + ' ' + path
|
||||
ProcessUtilities.executioner(command)
|
||||
else:
|
||||
import os
|
||||
|
||||
@@ -317,4 +325,3 @@ def main():
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user