From: Roy Marples Date: Wed, 14 Dec 2011 07:59:54 +0000 (+0000) Subject: Only regen resolv.conf if we need to as some processes could monitor it X-Git-Tag: v5.5.0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83c08c2068b3f264906a7c0222f974cd248244ba;p=thirdparty%2Fdhcpcd.git Only regen resolv.conf if we need to as some processes could monitor it for changes and restart themselves needlessly. --- diff --git a/dhcpcd-hooks/20-resolv.conf b/dhcpcd-hooks/20-resolv.conf index fbb64dca..73ae92a7 100644 --- a/dhcpcd-hooks/20-resolv.conf +++ b/dhcpcd-hooks/20-resolv.conf @@ -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" }