diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-12-18 18:08:34 -0300 |
---|---|---|
committer | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-12-19 11:16:15 -0300 |
commit | 2bb48366937bf0d5191be954ea21c671c3722d04 (patch) | |
tree | 2d24cd2e3b996c8603c5951067a3ca5484ad8dea /pkg/linux/resolv-update | |
parent | cd3250d20a60ab6ec5654bba8ec35e6d12cce03f (diff) |
Avoids permanent break of resolv.conf.
The resolv.conf file gets updated by resolvconf, maintaining it as a
symlink allows the system to reset it during boot time. That is useful
when the app has a hard crash that gives no chance to roll back our
changes.
[Closes #4633]
Diffstat (limited to 'pkg/linux/resolv-update')
-rwxr-xr-x | pkg/linux/resolv-update | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/linux/resolv-update b/pkg/linux/resolv-update index 601d3bd2..c308b788 100755 --- a/pkg/linux/resolv-update +++ b/pkg/linux/resolv-update @@ -70,7 +70,7 @@ SETVAR R="${R}nameserver $NS " done - mv /etc/resolv.conf /etc/resolv.conf.bak + cp /etc/resolv.conf /etc/resolv.conf.bak echo "$comment $custom_head $R @@ -79,8 +79,8 @@ $custom_tail" > /etc/resolv.conf function down() { if [ -f /etc/resolv.conf.bak ] ; then - unlink /etc/resolv.conf - mv /etc/resolv.conf.bak /etc/resolv.conf + cat /etc/resolv.conf.bak > /etc/resolv.conf + rm /etc/resolv.conf.bak fi } |