2010-05-01 18:22:01 +00:00
|
|
|
#!/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.
|
|
|
|
|
|
|
|
[ "$DEVICE" == "lo" ] && exit 0
|
|
|
|
|
2012-06-05 16:04:23 +00:00
|
|
|
. /lib/functions.sh
|
2010-05-01 18:22:01 +00:00
|
|
|
. /lib/firewall/core.sh
|
2010-05-17 12:47:14 +00:00
|
|
|
|
2010-05-19 00:50:14 +00:00
|
|
|
fw_init
|
|
|
|
fw_is_loaded || exit 0
|
2010-05-01 18:22:01 +00:00
|
|
|
|
|
|
|
case "$ACTION" in
|
|
|
|
ifup)
|
2010-05-19 00:50:14 +00:00
|
|
|
fw_configure_interface "$INTERFACE" add "$DEVICE" &
|
2010-05-17 12:47:14 +00:00
|
|
|
;;
|
2010-05-01 18:22:01 +00:00
|
|
|
ifdown)
|
2010-09-15 01:53:36 +00:00
|
|
|
fw_configure_interface "$INTERFACE" del "$DEVICE"
|
2010-05-17 12:47:14 +00:00
|
|
|
;;
|
2010-05-01 18:22:01 +00:00
|
|
|
esac
|