其实很菜的哈哈
#!/bin/bash
#gj game server start procedure
#xcn qq:995345781
#version 2.0
PATH_DIR=/application/game/game002
prog=game002
start() {
[ "$EUID" != "0" ] && exit 4
cd /application/game/game002/
./game002 -d
echo -n $"starting $prog:"
if [ "$?" -ne 0 ]
then
echo "start erro"
fi
}
stop() {
[ "$EUID" != "0" ] && exit 4
echo -n $"stoping down $prog:"
kill `cat $PATH_DIR/server.pid`
}
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo $"usage:$0 {start|stop}"
exit 2
esac