aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-xpackage/base-files/files/usr/share/udhcpc/default.script7
1 files changed, 4 insertions, 3 deletions
diff --git a/package/base-files/files/usr/share/udhcpc/default.script b/package/base-files/files/usr/share/udhcpc/default.script
index a3a696be70..7ce3d2aa89 100755
--- a/package/base-files/files/usr/share/udhcpc/default.script
+++ b/package/base-files/files/usr/share/udhcpc/default.script
@@ -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