[package] firewall: use uci_get_state() wrapper
[openwrt.git] / package / firewall / files / firewall.hotplug
index fa5643a..bc75e42 100644 (file)
@@ -8,12 +8,21 @@
 [ "$DEVICE" == "lo" ] && exit 0
 
 . /lib/firewall/core.sh
-fw_is_loaded || exit 0
 fw_init
 
+# Wait for firewall if startup is in progress
+lock -w /var/lock/firewall.start
+
 case "$ACTION" in
        ifup)
-               fw_configure_interface "$INTERFACE" add "$DEVICE" ;;
+               fw_is_loaded && {
+                       fw_configure_interface "$INTERFACE" add "$DEVICE" &
+               } || {
+                       /etc/init.d/firewall enabled && fw_start &
+               }
+       ;;
        ifdown)
-               fw_configure_interface "$INTERFACE" del "$DEVICE" ;;
+               fw_is_loaded && fw_configure_interface "$INTERFACE" del "$DEVICE" &
+       ;;
 esac
+
This page took 0.028991 seconds and 4 git commands to generate.