#!/bin/sh
#

APPDIR=/ross/app/rippa/node/scripts

start() {
	source /tmp/eeprom
 	echo -n "Starting rippaview server: "
	OLDDIR=`pwd`
	cd $APPDIR
	./rippaServer.sh start
	cd $OLDDIR
	echo "OK"
}

stop() {
	echo -n "Stopping rippaview server: "
	OLDDIR=`pwd`
	cd $APPDIR
	./rippaServer.sh stop
	echo "Done."
	cd $OLDDIR
	echo "Done."
}

restart() {
	stop
	start
}

case "$1" in
	start)
		start
		;;
	stop)
		stop
		;;
	restart|reload)
		restart
		;;
	*)
		echo "Usage: $0 {start|stop|restart}"
		exit 1
		;;
esac

exit $?
