mirror of
https://github.com/gryf/wicd.git
synced 2026-03-03 07:15:46 +01:00
Fix error when trying to overwrite existing /etc/resolv.conf with the backup
This commit is contained in:
@@ -1802,6 +1802,7 @@ def main(argv):
|
|||||||
backup_location = wpath.varlib + 'resolv.conf.orig'
|
backup_location = wpath.varlib + 'resolv.conf.orig'
|
||||||
if os.path.islink(backup_location):
|
if os.path.islink(backup_location):
|
||||||
dest = os.readlink(backup_location)
|
dest = os.readlink(backup_location)
|
||||||
|
os.remove('/etc/resolv.conf')
|
||||||
os.symlink(dest, '/etc/resolv.conf')
|
os.symlink(dest, '/etc/resolv.conf')
|
||||||
else:
|
else:
|
||||||
shutil.move(backup_location, '/etc/resolv.conf')
|
shutil.move(backup_location, '/etc/resolv.conf')
|
||||||
|
|||||||
Reference in New Issue
Block a user