summaryrefslogtreecommitdiff
path: root/firewall/files/firewall.hotplug
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2021-05-15 13:16:12 +0200
committerKarel Kočí <cynerd@email.cz>2021-05-15 13:16:12 +0200
commit53f535f7ccfeaf191c11350f422b062b68870ae3 (patch)
treeb552c105827df5d35661a83dc325ecdd6e2fa88d /firewall/files/firewall.hotplug
parentef7468756e2e509c3972b95da934a02173c34a0a (diff)
downloadopenwrt-personal-pkgs-53f535f7ccfeaf191c11350f422b062b68870ae3.tar.gz
openwrt-personal-pkgs-53f535f7ccfeaf191c11350f422b062b68870ae3.tar.bz2
openwrt-personal-pkgs-53f535f7ccfeaf191c11350f422b062b68870ae3.zip
firewall: add to test
Diffstat (limited to 'firewall/files/firewall.hotplug')
-rw-r--r--firewall/files/firewall.hotplug11
1 files changed, 11 insertions, 0 deletions
diff --git a/firewall/files/firewall.hotplug b/firewall/files/firewall.hotplug
new file mode 100644
index 0000000..f1eab00
--- /dev/null
+++ b/firewall/files/firewall.hotplug
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+[ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0
+[ "$ACTION" = ifupdate -a -z "$IFUPDATE_ADDRESSES" -a -z "$IFUPDATE_DATA" ] && exit 0
+
+/etc/init.d/firewall enabled || exit 0
+
+fw3 -q network "$INTERFACE" >/dev/null || exit 0
+
+logger -t firewall "Reloading firewall due to $ACTION of $INTERFACE ($DEVICE)"
+fw3 -q reload