:
# Ingres Startup/Shutdown Script

II_SYSTEM=/acad1-apps
PATH=$PATH:$II_SYSTEM/ingres/bin:$II_SYSTEM/ingres/utility:/apps/academy/bin
export II_SYSTEM PATH

if [ -d %II_SYSTEM/ingres ]
then
	"Apps filesystem not mounted.."
	exit 0
fi

case $1 in
	start)
		su ingres -c "$II_SYSTEM/ingres/utility/ingstart";;
	stop)
		if [ -f /etc/academy_dblist ]
		then
			echo "Stopping Academy Schedulers Please Wait..."
			for i in `cat /etc/academy_dblist`
			do
				su aisdba -c "/apps/academy/bin/stop_sched $i"
			done
			sleep 10
		fi

		# Try the ordinary way first
		su ingres -c "$II_SYSTEM/ingres/utility/ingstop"
		# Run it again with force option
		su ingres -c "echo y | $II_SYSTEM/ingres/utility/ingstop -f"
		;;

	*)
		echo "The only options are stop or start"
esac	
