#!@SHELL@ test -r test.pid && PID=`cat test.pid` echo PID is $PID if test -z "$PID"; then echo cannot find pid of running server exit 1 fi if kill $PID; then echo "server running, trying to stop" else echo "server was already stopped" exit 1 fi rm -f test.pid sleep 1 if kill -0 $PID 2>/dev/null; then echo "server still running" exit 1 else echo "server stopped" exit 0 fi