All pastes #254198 Raw Edit

Mine

public text v1 · immutable
#254198 ·published 2006-11-21 16:35 UTC
rendered paste body
Index: package/base-files/default/etc/functions.sh
===================================================================
--- package/base-files/default/etc/functions.sh (revision 5466)
+++ package/base-files/default/etc/functions.sh (working copy)
@@ -60,12 +60,11 @@
                         } done
                 }
-               [ -f /tmp/resolv.conf.auto ] || {
-                       debug "# --- creating /tmp/resolv.conf.auto ---"
-                       for dns in $(nvram get ${2}_dns); do
-                               echo "nameserver $dns" >> /tmp/ resolv.conf.auto
-                       done
-               }
+               debug "# --- updating /tmp/resolv.conf.auto ---"
+               for dns in $(nvram get ${2}_dns); do
+                   grep "^nameserver $dns" /tmp/resolv.conf.auto >/dev/null 2>&1 || \
+                       echo "nameserver $dns" >> /tmp/resolv.conf.auto
+               done
                 env -i ACTION="ifup" INTERFACE="${2}" PROTO=static /sbin/hotplug "iface" &
         ;;