summaryrefslogtreecommitdiff
path: root/firewall/files/firewall.hotplug
diff options
context:
space:
mode:
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