#! /bin/sh
#
# This file was automatically customized by debmake on Tue, 23 Feb 1999 18:40:08 -0600
#
# 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
export PATH
DAEMON=/usr/sbin/fakebo

# 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 50"

test -f $DAEMON || exit 0

case "$1" in
  start)
    echo -n "Starting fakebo daemon... "
    start-stop-daemon --start --quiet --exec $DAEMON -- -b
    echo "done"
    ;;
  stop)
    echo -n "Stopping fakebo daemon... "
    start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
    echo "done"
    ;;
  restart|force-reload)
    echo -n "Restarting fakebo daemon... "
    start-stop-daemon --stop --quiet --exec $DAEMON
    sleep 2
    start-stop-daemon --start --quiet --exec $DAEMON -- -b
    echo "done"
    ;;
  *)
    echo "Usage: /etc/init.d/fakebo {start|stop|restart|force-reload}"
    exit 1
    ;;
esac

exit 0
