keep track of the network interface states (stored in uci format in /var/state/network, overlay over /etc/config/network)

SVN-Revision: 7643
This commit is contained in:
Felix Fietkau
2007-06-16 00:01:33 +00:00
parent 8e2643a8b5
commit 4f16e9cc3e
7 changed files with 53 additions and 8 deletions

View File

@@ -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
}