1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-25 07:32:29 +01:00

Fix error when trying to overwrite existing /etc/resolv.conf with the backup

This commit is contained in:
David Paleino
2012-11-01 00:27:50 +01:00
parent ad8fab20d2
commit 20e02cd191

View File

@@ -1802,6 +1802,7 @@ def main(argv):
backup_location = wpath.varlib + 'resolv.conf.orig'
if os.path.islink(backup_location):
dest = os.readlink(backup_location)
os.remove('/etc/resolv.conf')
os.symlink(dest, '/etc/resolv.conf')
else:
shutil.move(backup_location, '/etc/resolv.conf')