diff options
author | Felix Fietkau <nbd@openwrt.org> | 2007-06-16 00:01:33 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2007-06-16 00:01:33 +0000 |
commit | 4f16e9cc3e2c187d19b24785a55ce30a892efd68 (patch) | |
tree | 2f0c604247fa6fd86171a5e3398a4a662f99cb06 /package/base-files/files/usr | |
parent | 8e2643a8b517b0ff5030f05020c48fc7bc0e85c2 (diff) | |
download | upstream-4f16e9cc3e2c187d19b24785a55ce30a892efd68.tar.gz upstream-4f16e9cc3e2c187d19b24785a55ce30a892efd68.tar.bz2 upstream-4f16e9cc3e2c187d19b24785a55ce30a892efd68.zip |
keep track of the network interface states (stored in uci format in /var/state/network, overlay over /etc/config/network)
SVN-Revision: 7643
Diffstat (limited to 'package/base-files/files/usr')
-rwxr-xr-x | package/base-files/files/usr/share/udhcpc/default.script | 8 |
1 files changed, 7 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 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 } |