root/athena-start

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
5PATH=./:$PATH
6
7L_SRV=login-server_sql
8C_SRV=char-server_sql
9M_SRV=map-server_sql
10
11print_start() {
12#    more << EOF
13echo "Athena Starting..."
14echo "            (c) 2003 Athena Project"
15echo "              modified by shazeya@syafi.com"
16echo ""
17#echo "Debug informations will appear,"
18#echo "since this is a test release."
19#echo ""
20echo "checking..."
21#EOF
22}
23
24check_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
36echo "Check complete."
37echo "Looks good, a nice Athena!"
38#EOF
39}
40   
41
42case $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;;
63esac
Note: See TracBrowser for help on using the browser.