Revision 1, 1.2 kB
(checked in by jinshiro, 17 years ago)
|
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | # athena starting script by rowla |
---|
3 | # modified by shazeya@syafi.com (NL101541) |
---|
4 | |
---|
5 | PATH=./:$PATH |
---|
6 | |
---|
7 | L_SRV=login-server_sql |
---|
8 | C_SRV=char-server_sql |
---|
9 | M_SRV=map-server_sql |
---|
10 | |
---|
11 | print_start() { |
---|
12 | # more << EOF |
---|
13 | echo "Athena Starting..." |
---|
14 | echo " (c) 2003 Athena Project" |
---|
15 | echo " modified by shazeya@syafi.com" |
---|
16 | echo "" |
---|
17 | #echo "Debug informations will appear," |
---|
18 | #echo "since this is a test release." |
---|
19 | #echo "" |
---|
20 | echo "checking..." |
---|
21 | #EOF |
---|
22 | } |
---|
23 | |
---|
24 | check_files() { |
---|
25 | |
---|
26 | for i in ${L_SRV} ${C_SRV} ${M_SRV} |
---|
27 | do |
---|
28 | if [ ! -f ./$i ]; then |
---|
29 | echo "$i does not exist, or can't run." |
---|
30 | echo "Stop. Check your compile." |
---|
31 | exit 1; |
---|
32 | fi |
---|
33 | done |
---|
34 | |
---|
35 | # more << EOF |
---|
36 | echo "Check complete." |
---|
37 | echo "Looks good, a nice Athena!" |
---|
38 | #EOF |
---|
39 | } |
---|
40 | |
---|
41 | |
---|
42 | case $1 in |
---|
43 | 'start') |
---|
44 | print_start |
---|
45 | check_files |
---|
46 | |
---|
47 | exec ./${L_SRV}& |
---|
48 | exec ./${C_SRV}& |
---|
49 | exec ./${M_SRV}& |
---|
50 | |
---|
51 | echo "Now Started Athena." |
---|
52 | ;; |
---|
53 | 'stop') |
---|
54 | ps ax | grep -E "${L_SRV}|${C_SRV}|${M_SRV}" | awk '{print $1}' | xargs kill |
---|
55 | ;; |
---|
56 | 'restart') |
---|
57 | $0 stop |
---|
58 | $0 start |
---|
59 | ;; |
---|
60 | *) |
---|
61 | echo "Usage: athena-start { start | stop | restart }" |
---|
62 | ;; |
---|
63 | esac |
---|