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

# 避免ipv6对hotplug影响
[ ${INTERFACE:$((${#INTERFACE}-2))} == "v6" ] && exit 0

[ "$DEVICE" == "lo" ] && exit 0

. /lib/functions.sh
. /lib/zone/zone_api.sh
. /lib/imb/core_global.sh

IMB_PREFIX="imb_ipmac_"
IP_PREFIX="imb_ip_"



case "$ACTION" in
	ifup)
		fw_imb_event_interface "$INTERFACE" add WAN

	;;
	ifdown)
		fw_imb_event_interface "$INTERFACE" del WAN
	
	;;
	ifupdate)
		# do nothing
	;;
esac
