#!/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

[ ! -f /tmp/access_ctl.ready ] && {
	exit 0
}

local flag=$(uci get access_ctl.@rule_acl_inner[0] 2>/dev/null)
[ -z "$flag" ] && exit 0

case "$ACTION" in
	ifup)
		#fw_acl_event_interface "$INTERFACE" add
		#/lib/access_ctl/interface.sh "$INTERFACE" add
	;;
	ifdown)
		#fw_acl_event_interface "$INTERFACE" del
		#/lib/access_ctl/interface.sh "$INTERFACE" del
	;;
	ifupdate)
		# do nothing
	;;
esac
