summaryrefslogtreecommitdiffstats
path: root/package/base-files/files/usr/share
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files/files/usr/share')
-rwxr-xr-xpackage/base-files/files/usr/share/udhcpc/default.script8
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 53bb6999f..a3a696be7 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
}