#!/bin/sh
#
# This file was automatically customized by debmake on Sun, 24 Nov 1996 20:32:09 +0100
#
# Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>.
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for Debian by Christoph Lameter <clameter@debian.org>

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/arpd
# The following value is extracted by debstd to figure out how to generate
# the postinst script. Edit the field to change the way the script is
# registered through update-rc.d (see the manpage for update-rc.d!)
FLAGS="defaults 20"

test -f $DAEMON || exit 0

usage () {
  echo "Usage: $0 {start|stop|reload|force-reload|force-restart}" 1>&2
  exit 1
}

dorun () {
  case "$1" in
    start)
      if [ -c /dev/arpd ]; then
        echo -n "Starting user-space ARP daemon: arpd"
        start-stop-daemon --start --verbose --quiet --exec $DAEMON
        echo "."
      else
         echo "Not starting ARP daemon without /dev/arpd."
      fi
      ;;
    stop)
      echo -n "Stopping user-space ARP daemon: arpd"
      start-stop-daemon --quiet --stop --verbose --exec $DAEMON
      echo "."
      ;;
    restart)
      dorun force-restart
      ;;
    force-reload)
      dorun force-restart
      ;;
    force-restart)
      dorun stop
      dorun start
      ;;
    *)
      usage
      ;;
  esac
}

if [ "$#" -eq "1" ]; then
  dorun "$1"
else
  usage
fi

exit 0
