#! /bin/sh
#
# Start/Stop ASPseek searchd service
#
# check the package is installed

test -x /usr/sbin/searchd || exit 0

# Instructions:
#
#  1. Create the sql database and tables (see appropriate template in
#     /usr/share/doc/aspseek/sql).
#  2. Edit configuration files in /etc/aspseek (aspseek.conf and searchd.conf)
#     for your local environment.
#  3. Comment out or remove the next two lines that contain the echo and exit.

echo "You must customize /etc/init.d/aspseek before searchd can be run."
exit 0

case "$1" in
    start)
        echo -n "Starting ASPseek searchd: searchd"
	/usr/sbin/searchd -D -R >/dev/null 2>&1
        echo "."
        ;;
    stop)
	echo -n "Stopping ASPseek searchd: searchd"
        start-stop-daemon --stop --quiet --exec /usr/sbin/searchd >/dev/null 2>&1
        echo "."
        ;;
    restart)
	echo -n "Restarting ASPseek searchd: searchd"
	start-stop-daemon --stop --oknodo --quiet --exec /usr/sbin/searchd >/dev/null 2>&1
	/usr/sbin/searchd -D -R >/dev/null 2>&1
        echo "."
	;;
    force-reload)
	$0 restart
	;;
    reload)
	$0 restart
	;;
    *)
        echo "Usage: /etc/init.d/searchd {start|stop|restart}"
        exit 1
	;;
esac

exit 0
