diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-05-10 15:53:02 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-05-10 15:53:02 +0000 |
commit | 9dc0d60ad6eb0f8280912d10dafc7a5aac72998d (patch) | |
tree | 9861bb0a7049e7cdb62bfe852c1b75d27e850206 /package/base-files/files/usr | |
parent | 1421bc8dbefe918849cd0dbf61bdf7915e724496 (diff) | |
download | master-187ad058-9dc0d60ad6eb0f8280912d10dafc7a5aac72998d.tar.gz master-187ad058-9dc0d60ad6eb0f8280912d10dafc7a5aac72998d.tar.bz2 master-187ad058-9dc0d60ad6eb0f8280912d10dafc7a5aac72998d.zip |
[package] base-files:
- restore device, ifname and aliases state in dhcp script
- make sure that resolv.conf.tmp is written once at least for statically configured dns
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15753 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/usr')
-rwxr-xr-x | package/base-files/files/usr/share/udhcpc/default.script | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/package/base-files/files/usr/share/udhcpc/default.script b/package/base-files/files/usr/share/udhcpc/default.script index 7dfb0f93e2..b22cc8b04d 100755 --- a/package/base-files/files/usr/share/udhcpc/default.script +++ b/package/base-files/files/usr/share/udhcpc/default.script @@ -68,7 +68,7 @@ setup_interface () { user_dns=$(uci_get "network.$ifc.dns") [ -n "$user_dns" ] && dns="$user_dns" - [ -n "$dns" ] && [ "$dns" != "$old_dns" ] && { + [ -n "$dns" ] && [ ! -s "${RESOLV_CONF}.tmp" -o "$dns" != "$old_dns" ] && { echo "udhcpc: setting dns servers: $dns" echo -n > "${RESOLV_CONF}.tmp" for i in $dns ; do @@ -110,7 +110,14 @@ for ifc in $interfaces; do deconfig) ifconfig "$interface" 0.0.0.0 env -i ACTION="ifdown" INTERFACE="$ifc" DEVICE="$ifname" PROTO=dhcp /sbin/hotplug-call iface + + config_get device "$ifc" device + config_get ifname "$ifc" ifname + config_get aliases "$ifc" aliases uci_revert_state network "$ifc" + [ -n "$device" ] && uci_set_state network "$ifc" device "$device" + [ -n "$ifname" ] && uci_set_state network "$ifc" ifname "$ifname" + [ -n "$aliases" ] && uci_set_state network "$ifc" aliases "$aliases" ;; renew) setup_interface update |