From 1f4c302e331fd9a64e598749f3d602d355050107 Mon Sep 17 00:00:00 2001 From: rperper Date: Mon, 29 Oct 2018 11:30:44 -0400 Subject: [PATCH] Fixing again the code to deal with /etc/resolv.conf --- install/unInstall.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/install/unInstall.py b/install/unInstall.py index a4d332b11..f9971e48b 100644 --- a/install/unInstall.py +++ b/install/unInstall.py @@ -16,6 +16,22 @@ distro = install.get_distro() class unInstallCyberPanel: + def fixResolvConf(self): + if distro == centos: + return + + if os.access('/etc/resolv.conf', os.F_OK): + return + + try: + f = open('/etc/resolv.conf', 'w') + f.write('nameserver 8.8.8.8') + f.close() + except IOError as e: + print "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'" + def unInstallCyberPanelRepo(self): if distro == centos: @@ -201,6 +217,7 @@ def Main(): remove = unInstallCyberPanel() + remove.fix remove.removeLiteSpeed() remove.removeMysql() remove.removePostfixDovecot()