#!/sbin/sh
# Start/stop cego daemon 
#

. /lib/svc/share/smf_include.sh

case "$1" in
'start')
        /usr/local/bin/cego --mode=daemon --dbxml=/usr/local/cegodb/cegodb.xml --logfile=/usr/local/cegodb/cego.log  &
        sleep 2
        ;;
'restart')
        /usr/local/bin/cego --mode=daemon --dbxml=/usr/local/cegodb/cegodb.xml --logfile=/usr/local/cegodb/cego.log &
        sleep 2
        ;;
'stop')
	PID=`cat /usr/local/cegodb/pid`
        /usr/bin/kill -s INT $PID 
        ;;
*)
        echo "Usage: $0 { start | stop }"
        exit 1
        ;;
esac
exit $SMF_EXIT_OK
