#!/bin/bash
# Example interface hook.
#
# Interface hooks are run with the "start" argument after an interface has been
# brought up and with the "stop" argument before it is destroyed.
#
# Environment variables:
#   ID: interface ID
#   INTERFACE: the full name of the interface (eg: eth3, eth3.200)
#   INTERFACE_BASE: the name of the base interface (eg: eth3 if the INTERFACE is eth3.200)
#   INTERFACE_MAC: The configured MAC address, if set
#   INTERFACE_MTU: The configured MTU, if set
#   INTERFACE_MODE: the ethernet mode of the interface. Only present on Ethernet interfaces
#   INTERFACE_IP_ADDRESSES: A space seperated list of IP addresses in CIDR notation for this interface (eg: 192.168.0.1/24 10.0.0.1/16)

start () {
    remove 2> /dev/null
    true
}
stop () {
    remove
}
remove () {
    true
}

# Avoid changing anything below here.
case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    *)
        echo "Usage: $0 {start|stop}"
        exit 1
        ;;
esac
