This patch makes the network status file in /tmp/ consistent, so that when an interface goes down, any script parsing the file can see it! This can be a pretty good alternative to json when you need a VERY small script.

Index: package/network/config/netifd/files/etc/hotplug.d/iface/00-netstate
===================================================================
--- package/network/config/netifd/files/etc/hotplug.d/iface/00-netstate 
(revision 37055)
+++ package/network/config/netifd/files/etc/hotplug.d/iface/00-netstate 
(working copy)
@@ -6,3 +6,7 @@
                uci_toggle_state network "$INTERFACE" ifname "$DEVICE"
        }
 }
+
+[ ifdown = "$ACTION" ] && {
+       uci_toggle_state network "$INTERFACE" up 0
+}



_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to