aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files-network/files/etc/hotplug.d/iface/00-netstate
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-10-20 15:01:06 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-10-20 15:01:06 +0000
commitc2b5767572c7cece21f7739e416d59458278b7d8 (patch)
treebbb6d468090141c8fe0367f573272ec8289fa755 /package/base-files-network/files/etc/hotplug.d/iface/00-netstate
parentfce837994043793008be610cb24154d649c7b190 (diff)
downloadupstream-c2b5767572c7cece21f7739e416d59458278b7d8.tar.gz
upstream-c2b5767572c7cece21f7739e416d59458278b7d8.tar.bz2
upstream-c2b5767572c7cece21f7739e416d59458278b7d8.zip
base-files: move network related scripts to a separate package to make the transition to netifd easier
SVN-Revision: 28495
Diffstat (limited to 'package/base-files-network/files/etc/hotplug.d/iface/00-netstate')
-rw-r--r--package/base-files-network/files/etc/hotplug.d/iface/00-netstate5
1 files changed, 5 insertions, 0 deletions
diff --git a/package/base-files-network/files/etc/hotplug.d/iface/00-netstate b/package/base-files-network/files/etc/hotplug.d/iface/00-netstate
new file mode 100644
index 0000000000..37b1e934eb
--- /dev/null
+++ b/package/base-files-network/files/etc/hotplug.d/iface/00-netstate
@@ -0,0 +1,5 @@
+[ ifup = "$ACTION" ] && {
+ uci_toggle_state network "$INTERFACE" up 1
+ uci_toggle_state network "$INTERFACE" connect_time $(sed -ne 's![^0-9].*$!!p' /proc/uptime)
+ [ -n "$DEVICE" ] && uci_toggle_state network "$INTERFACE" ifname "$DEVICE"
+}