#! /bin/sh
#
# 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/gated

test -f $DAEMON || exit 0

case "$1" in
  start)
    echo -n "Starting routing daemon: gated"
    start-stop-daemon --start --quiet --pidfile /var/run/gated.pid \
	--exec $DAEMON
    echo "."
    ;;
  stop)
    echo -n "Stopping routing daemon: gated"
    start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/gated.pid \
	--exec $DAEMON
    echo "."
    ;;
  reload)
    echo -n "Reloading gated configuration..."
    start-stop-daemon --stop --quiet --signal 1 --pidfile /var/run/gated.pid \
	--exec $DAEMON
    echo "done."
    ;;
  *)
    echo "Usage: /etc/init.d/gated {start|stop|reload}"
    exit 1
    ;;
esac

exit 0
