#!/bin/sh
#
# setiathome:   Starts the setiathome client
#
# Version:      @(#) /etc/rc.d/init.d/setiathome 1.0
#
# Author:       Jason Spangler <jasons@usemail.com>
#
# chkconfig: 345 98 01
# description: SETI@home is a scientific experiment that will harness the power\
#    of hundreds of thousands of Internet-connected computers in the Search for\
#    Extraterrestrial Intelligence (SETI). You can participate by running a\
#    program that downloads and analyzes radio telescope data. There's a\
#    small but captivating possibility that your computer will detect the faint\
#    murmur of a civilization beyond Earth. 
# processname: setiathome
# config: /etc/setiathome/user_info.txt

# Source function library.
. /etc/rc.d/init.d/functions

# See how we were called.
case "$1" in
  start)
	echo -n "Starting setiathome client: "
	daemon --check setiathome "su setiathome -c 'cd /etc/setiathome && exec /usr/bin/setiathome -nice 20 -email > /dev/null 2>&1 &'"
	echo
	touch /var/lock/subsys/setiathome
	;;
  stop)
	echo -n "Stopping setiathome client: "
	killproc setiathome
	rm -f /var/lock/subsys/setiathome
        echo
	;;
  status)
	status setiathome
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: $0 {start|stop|status|restart}"
	exit 1
esac

exit 0

