mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-10 23:36:11 +01:00
Fixing again the code to deal with /etc/resolv.conf
This commit is contained in:
@@ -872,11 +872,14 @@ class InstallCyberPanel:
|
|||||||
except OSError as e1:
|
except OSError as e1:
|
||||||
InstallCyberPanel.stdOut("Unable to remove existing /etc/resolv.conf to install PowerDNS: " +
|
InstallCyberPanel.stdOut("Unable to remove existing /etc/resolv.conf to install PowerDNS: " +
|
||||||
str(e1), 1, 1, os.EX_OSERR)
|
str(e1), 1, 1, os.EX_OSERR)
|
||||||
command = 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'
|
try:
|
||||||
res = subprocess.call(shlex.split(command))
|
f = open('/etc/resolv.conf', 'w')
|
||||||
if (res != 0):
|
f.write('nameserver 8.8.8.8')
|
||||||
InstallCyberPanel.stdOut("Unable to create new /etc/resolv.conf to point to 'nameserver 8.8.8.8'"
|
f.close()
|
||||||
" You may need to do this manually to continue", 1, 1, os.EX_OSERR)
|
except IOError as e:
|
||||||
|
InstallCyberPanel.stdOut("Unable to create /etc/resolv.conf: " + str(e) +
|
||||||
|
". This may need to be fixed manually as 'echo \"nameserver 8.8.8.8\"> "
|
||||||
|
"/etc/resolv.conf'", 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
|
|
||||||
if self.distro == centos:
|
if self.distro == centos:
|
||||||
|
|||||||
Reference in New Issue
Block a user