aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-05-10 15:53:02 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-05-10 15:53:02 +0000
commit33c38fba27eb5892dd1a84af5ab9c1117e84103a (patch)
treef3760565cf65057d6ffd660de0b5cb2022565833 /package/base-files
parent6fc1c45b63166c10504cb8743f54b4e50f146290 (diff)
downloadupstream-33c38fba27eb5892dd1a84af5ab9c1117e84103a.tar.gz
upstream-33c38fba27eb5892dd1a84af5ab9c1117e84103a.tar.bz2
upstream-33c38fba27eb5892dd1a84af5ab9c1117e84103a.zip
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
SVN-Revision: 15753
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/usr/share/udhcpc/default.script9
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