#!/bin/sh
set -e

#need dbus and hald

start() {
    echo -n "Starting Exalt daemon..."
    start-stop-daemon --start --exec /usr/sbin/exalt-daemon \
        --pidfile /var/run/exaltd.pid
    echo "done."
}

stop() {
    echo -n "Stopping Exalt daemon..."
    start-stop-daemon --stop --exec /usr/sbin/exalt-daemon \
	--pidfile /var/run/exaltd.pid
    echo "done."
}

case "$1" in
    start)
	start
	;;
    stop)
	stop
	;;
    restart)
	stop
	sleep 2
	start
	;;
    *)
	echo "Usage: $(basename $0) {start|stop|restart}"
	exit 1
esac

exit 0