]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Only regen resolv.conf if we need to as some processes could monitor it
authorRoy Marples <roy@marples.name>
Wed, 14 Dec 2011 07:59:54 +0000 (07:59 +0000)
committerRoy Marples <roy@marples.name>
Wed, 14 Dec 2011 07:59:54 +0000 (07:59 +0000)
for changes and restart themselves needlessly.

dhcpcd-hooks/20-resolv.conf

index fbb64dca0030f343d59642f54afd343cb1bda297..73ae92a79747338164aa3a81d389a53cf9c0792b 100644 (file)
@@ -63,8 +63,9 @@ build_resolv_conf()
        else
                echo "# /etc/resolv.conf.tail can replace this line" >> "$cf"
        fi
-       cat "$cf" > /etc/resolv.conf
-       chmod 644 /etc/resolv.conf
+       if change_file /etc/resolv.conf "$cf"; then
+               chmod 644 /etc/resolv.conf
+       fi
        rm -f "$cf"
 }