+case "$1" in
+ start)
+ if [ ! -f $PID_FILE ]; then
+ do_start
+ else
+ pid=`cat $PID_FILE`
+ psout=`ps -A | grep $pid | grep -v grep | awk "{if (\\\$1 == $pid) print}"`
+ if [ "x$psout" = "x" ]; then
+ echo "Found stale sshd pid file... removing it."
+ rm -f $PID_FILE
+ do_start
+ else
+ echo "GSI-OpenSSH sshd server is already running!"
+ fi
+ fi
+ ;;
+
+ stop)
+ if [ -f $PID_FILE ] ; then
+ do_stop
+ else
+ echo "The server's pid file does not exist! Are you sure the server is running?"
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ $0 start
+ ;;
+
+ *)
+ echo "Usage: $0 (start|stop|restart)"
+ exit 1