#!/bin/sh
#
# start/stop the SIAM application

#let the root scripts know where siam is located, this should probably be in
#config file called located /etc/siam/???.conf
SIAM_HOME=/mnt/hda/siam

#source /etc/profile so you have a path
. /etc/profile

case "$1" in
    start)
        echo "Starting SIAM application: "
	# start the the SIAM application
        su ops -c "$SIAM_HOME/utils/startnode"
	echo "done."
	;;
    stop)
        echo "Stopping SIAM application: "
        #invoke stopnode script and wait until it returns
        su ops -c  "$SIAM_HOME/utils/stopnode"
	echo "done."
	;;
    reload|restart|force-reload)
	$0 stop
        $0 start
        ;;
    *)
	echo "Usage: $0 {start|stop|reload|restart}"
	exit 1
	;;
esac

exit 0

