1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-27 19:18:07 +02:00

avoid a race condition that might lead to dnsmasq reading an empty resolv.conf (#2007)

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7952 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2007-07-12 21:59:38 +00:00
parent cbd05f24b2
commit fa2a6d6883

View File

@ -47,12 +47,13 @@ case "$1" in
}
[ -n "$dns" ] && {
echo -n > $RESOLV_CONF
${domain:+echo search $domain} >> $RESOLV_CONF
echo -n > "${RESOLV_CONF}.tmp"
${domain:+echo search $domain} >> "${RESOLV_CONF}.tmp"
for i in $dns ; do
echo "adding dns $i"
echo "nameserver $i" >> $RESOLV_CONF
echo "nameserver $i" >> "${RESOLV_CONF}.tmp"
done
mv "${RESOLV_CONF}.tmp" "$RESOLV_CONF"
}
hotplug_event ifup