aboutsummaryrefslogtreecommitdiffstats
path: root/package/firewall/files/firewall.hotplug
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-05-01 18:22:01 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-05-01 18:22:01 +0000
commitc284cb51c00625f52090f3fe3d475450eaab7b21 (patch)
tree02c49883956e50f28055df479accfa35c3c6fcdd /package/firewall/files/firewall.hotplug
parent085b2b9ad6216508ff357dcb49757173d269fbb9 (diff)
downloadupstream-c284cb51c00625f52090f3fe3d475450eaab7b21.tar.gz
upstream-c284cb51c00625f52090f3fe3d475450eaab7b21.tar.bz2
upstream-c284cb51c00625f52090f3fe3d475450eaab7b21.zip
firewall: - replace uci firewall with a modular dual stack implementation developed by Malte S. Stretz - bump version to 2
SVN-Revision: 21286
Diffstat (limited to 'package/firewall/files/firewall.hotplug')
-rw-r--r--package/firewall/files/firewall.hotplug19
1 files changed, 19 insertions, 0 deletions
diff --git a/package/firewall/files/firewall.hotplug b/package/firewall/files/firewall.hotplug
new file mode 100644
index 0000000000..fa5643a2bf
--- /dev/null
+++ b/package/firewall/files/firewall.hotplug
@@ -0,0 +1,19 @@
+#!/bin/sh
+# This script is executed as part of the hotplug event with
+# HOTPLUG_TYPE=iface, triggered by various scripts when an interface
+# is configured (ACTION=ifup) or deconfigured (ACTION=ifdown). The
+# interface is available as INTERFACE, the real device as DEVICE.
+. /etc/functions.sh
+
+[ "$DEVICE" == "lo" ] && exit 0
+
+. /lib/firewall/core.sh
+fw_is_loaded || exit 0
+fw_init
+
+case "$ACTION" in
+ ifup)
+ fw_configure_interface "$INTERFACE" add "$DEVICE" ;;
+ ifdown)
+ fw_configure_interface "$INTERFACE" del "$DEVICE" ;;
+esac