其实很菜的哈哈
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#!/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
|
本文转自 baishuchao 51CTO博客,原文链接:http://blog.51cto.com/baishuchao/1939993