#!/bin/sh
#
# chkconfig: 
# description: Runs the remote microscope server.
# processname: server.py

case "$1" in
  start)
	echo -n "Starting scope services: "
	cd /www/scope/bin ; su scoped --command="./microscoped"
	echo 'started'
	;;	

  stop)
	echo -n "Shutting down scope services: "
	killall microscoped
	echo 'stopped'
	;;	

  restart|reload)
	$0 stop
	$0 start
	;;

  *)
	echo "Usage: microscope {start|stop|restart|reload}"
	exit 1
esac

exit 0
