Archived
1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Files
archive/package/firewall/files/firewall.hotplug
Jo-Philipp Wich 49755bbe57 [backfire] merge dual stack firewall
SVN-Revision: 25353
2011-02-03 22:02:59 +00:00

23 lines
537 B
Bash

#!/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
. /etc/functions.sh
. /lib/firewall/core.sh
fw_init
fw_is_loaded || exit 0
case "$ACTION" in
ifup)
fw_configure_interface "$INTERFACE" add "$DEVICE" &
;;
ifdown)
fw_configure_interface "$INTERFACE" del "$DEVICE"
;;
esac