#!/bin/bash
# Example routed block hook.
#
# Routed block hooks are run with the "start" argument after a route is added
# and with the "stop" argument before it is removed.
#
# Environment variables:
#   ID: the route ID
#   BOND_ID: the ID of the routed block's bond
#   NETWORK: the route subnet
#   NETMASK: the netmask of the subnet
#   VIA: the next hop for packets destined for the subnet
#   AGG_ROUTING: string describing aggregator routing mode: one of "auto",
#     "always", or "never".

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
