Revision | 5ea352f398b0885870cc7e63e3e55c50e8f164e1 (tree) |
---|---|
Time | 2012-09-22 13:24:18 |
Author | h2so5 <h2so5@git....> |
Commiter | h2so5 |
deamon管理用のシェルスクリプトを追加
@@ -0,0 +1,42 @@ | ||
1 | +! /bin/bash | |
2 | +pidfile="./mmod.pid" | |
3 | +name="MikuMikuOnline Server" | |
4 | +prog="./server" | |
5 | +dir="./" | |
6 | +SSD=start-stop-daemon | |
7 | + | |
8 | +start() { | |
9 | + echo -n $"Starting $name: " | |
10 | + $SSD -S --pidfile $pidfile --make-pidfile --background --exec $prog -d $dir | |
11 | + RETVAL=$? | |
12 | + echo | |
13 | + return $RETVAL | |
14 | +} | |
15 | + | |
16 | +stop() { | |
17 | + echo -n $"Stopping $name: " | |
18 | + $SSD -K --oknodo --pidfile $pidfile -d $dir | |
19 | + RETVAL=$? | |
20 | + echo | |
21 | + return $RETVAL | |
22 | +} | |
23 | + | |
24 | +restart() { | |
25 | + stop | |
26 | + start | |
27 | +} | |
28 | + | |
29 | +case "$1" in | |
30 | + start) | |
31 | + start | |
32 | + ;; | |
33 | + stop) | |
34 | + stop | |
35 | + ;; | |
36 | + restart) | |
37 | + restart | |
38 | + ;; | |
39 | + *) | |
40 | + echo $"Usage: $0 {start|stop|restart}" | |
41 | + exit 1 | |
42 | +esac | |
\ No newline at end of file |