#! /bin/sh
#

case "$1" in
  start)
    if [ -f /usr/bin/netplugd ]; then
        echo "Starting netplugd..."
        /usr/bin/netplugd -c /etc/netplugd.conf -p /tmp/netplugd.pid
    else
        echo "No netplugd found, ignoring.."
    fi

    ;;
  stop)
    if [ -f /usr/bin/netplugd ]; then
        echo "Stopping netplugd..."
        killall netplugd
    fi
    ;;
  restart|reload)
    "$0" stop
    "$0" start
    ;;
  *)
    ;;
esac

exit $?
