#!/bin/sh

INTERFACE=$1
ACTION=$2

case "$ACTION" in
    up)
        logger -t ifplugd.sh "Interface $INTERFACE is up, bringing it online with ifup..."
        ifup $INTERFACE
        ;;
    down)
        logger -t ifplugd.sh "Interface $INTERFACE is down, bringing it offline with ifdown..."
        ifdown $INTERFACE
        ;;
    *)
        logger -t ifplugd.sh "Unknown action: $ACTION"
        ;;
esac

exit 0
