mirror of https://github.com/hak5/openwrt-owl.git
avoid a race condition that might lead to dnsmasq reading an empty resolv.conf (#2007)
SVN-Revision: 7952owl
parent
f82f62b992
commit
1b4380b8ed
|
@ -47,12 +47,13 @@ case "$1" in
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -n "$dns" ] && {
|
[ -n "$dns" ] && {
|
||||||
echo -n > $RESOLV_CONF
|
echo -n > "${RESOLV_CONF}.tmp"
|
||||||
${domain:+echo search $domain} >> $RESOLV_CONF
|
${domain:+echo search $domain} >> "${RESOLV_CONF}.tmp"
|
||||||
for i in $dns ; do
|
for i in $dns ; do
|
||||||
echo "adding dns $i"
|
echo "adding dns $i"
|
||||||
echo "nameserver $i" >> $RESOLV_CONF
|
echo "nameserver $i" >> "${RESOLV_CONF}.tmp"
|
||||||
done
|
done
|
||||||
|
mv "${RESOLV_CONF}.tmp" "$RESOLV_CONF"
|
||||||
}
|
}
|
||||||
|
|
||||||
hotplug_event ifup
|
hotplug_event ifup
|
||||||
|
|
Loading…
Reference in New Issue