summaryrefslogtreecommitdiff
path: root/package/base-files/files/etc
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2007-06-16 00:01:33 +0000
committerFelix Fietkau <nbd@openwrt.org>2007-06-16 00:01:33 +0000
commit4f16e9cc3e2c187d19b24785a55ce30a892efd68 (patch)
tree2f0c604247fa6fd86171a5e3398a4a662f99cb06 /package/base-files/files/etc
parent8e2643a8b517b0ff5030f05020c48fc7bc0e85c2 (diff)
downloadmtk-20170518-4f16e9cc3e2c187d19b24785a55ce30a892efd68.zip
mtk-20170518-4f16e9cc3e2c187d19b24785a55ce30a892efd68.tar.gz
mtk-20170518-4f16e9cc3e2c187d19b24785a55ce30a892efd68.tar.bz2
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/etc')
-rw-r--r--package/base-files/files/etc/hotplug.d/iface/00-netstate6
-rwxr-xr-xpackage/base-files/files/etc/init.d/boot1
2 files changed, 7 insertions, 0 deletions
diff --git a/package/base-files/files/etc/hotplug.d/iface/00-netstate b/package/base-files/files/etc/hotplug.d/iface/00-netstate
new file mode 100644
index 0000000..fce5472
--- /dev/null
+++ b/package/base-files/files/etc/hotplug.d/iface/00-netstate
@@ -0,0 +1,6 @@
+[ ifup = "$ACTION" ] && {
+ uci set "/var/state/network.$INTERFACE.up=1"
+ [ -z "$DEVICE" ] || {
+ uci set "/var/state/network.$INTERFACE.ifname=$DEVICE"
+ }
+}
diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot
index 7181f8b..02519fb 100755
--- a/package/base-files/files/etc/init.d/boot
+++ b/package/base-files/files/etc/init.d/boot
@@ -35,6 +35,7 @@ start() {
mkdir -p /var/run
mkdir -p /var/log
mkdir -p /var/lock
+ mkdir -p /var/state
touch /var/log/wtmp
touch /var/log/lastlog
ln -s /tmp/resolv.conf.auto /tmp/resolv.conf