From 46da1409881bee5a1b11691d286f773f38374bd9 Mon Sep 17 00:00:00 2001 From: nbd Date: Sat, 16 Jun 2007 00:01:33 +0000 Subject: keep track of the network interface states (stored in uci format in /var/state/network, overlay over /etc/config/network) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7643 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/usr/share/udhcpc/default.script | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'package/base-files/files/usr') diff --git a/package/base-files/files/usr/share/udhcpc/default.script b/package/base-files/files/usr/share/udhcpc/default.script index 53bb6999f6..a3a696be70 100755 --- a/package/base-files/files/usr/share/udhcpc/default.script +++ b/package/base-files/files/usr/share/udhcpc/default.script @@ -13,7 +13,13 @@ hotplug_event() { config_get proto $ifc proto [ "$proto" = "dhcp" ] || continue - + [ ifup = "$1" ] && { + uci set "/var/state/network.$ifc.ipaddr=$ip" + uci set "/var/state/network.$ifc.netmask=${subnet:-255.255.255.0}" + uci set "/var/state/network.$ifc.dnsdomain=$domain" + uci set "/var/state/network.$ifc.dns=$dns" + uci set "/var/state/network.$ifc.gateway=$router" + } env -i ACTION="$1" INTERFACE="$ifc" DEVICE="$ifname" PROTO=dhcp /sbin/hotplug-call iface done } -- cgit v1.2.3