2010-05-01 21:22:01 +03: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
|
|
|
|
|
2010-05-19 03:50:14 +03:00
|
|
|
. /etc/functions.sh
|
2010-05-01 21:22:01 +03:00
|
|
|
. /lib/firewall/core.sh
|
2010-05-17 15:47:14 +03:00
|
|
|
|
2010-05-19 03:50:14 +03:00
|
|
|
fw_init
|
|
|
|
fw_is_loaded || exit 0
|
2010-05-01 21:22:01 +03:00
|
|
|
|
|
|
|
case "$ACTION" in
|
|
|
|
ifup)
|
2010-05-19 03:50:14 +03:00
|
|
|
fw_configure_interface "$INTERFACE" add "$DEVICE" &
|
2010-05-17 15:47:14 +03:00
|
|
|
;;
|
2010-05-01 21:22:01 +03:00
|
|
|
ifdown)
|
2010-09-15 04:53:36 +03:00
|
|
|
fw_configure_interface "$INTERFACE" del "$DEVICE"
|
2010-05-17 15:47:14 +03:00
|
|
|
;;
|
2010-05-01 21:22:01 +03:00
|
|
|
esac
|