#! /bin/sh
#
# This file was automatically customized by debmake on Tue, 23 Jun 1998 23:26:12 -0500
#
# 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
# 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"


case "$1" in
  start)
    echo "Starting Home Control daemons: heyu, xtend"
    /usr/bin/heyu setclock
    /usr/bin/heyu info
    /usr/bin/xtend &
    ;;
  stop)
    /usr/bin/heyu stop
    rm /var/tmp/heyu.out
    rm /var/tmp/x10-status
    xtendpid=`pidof -o %PPID -o $$ xtend`
    kill -9 $xtendpid
    echo "."
    ;;
  *)
    echo "Usage: /etc/init.d/xtend {start|stop}"
    exit 1
    ;;
esac

exit 0
