forked from themanaworld/tmwa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eathena.sh
executable file
·54 lines (47 loc) · 1.23 KB
/
eathena.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# $Id: eathena.sh,v 1.5 2006/03/10 21:41:09 Platyna Exp $
#----------------------------------------------------------------------
# Description: Simple script to control eAthena locally.
# Author: Zuzanna K. Filutowska <[email protected]>
# Created at: Fri Feb 17 18:23:56 CET 2006
# License: GPL
# Copyright (c) 2006 Zuzanna K. Filutowska All rights reserved.
#
#----------------------------------------------------------------------
# Configure section:
PATH=$PATH:.
SRVHOMEDIR=$HOME/tmwserver
#----------------------------------------------------------------------
# main()
ulimit -u 10
cd ${SRVHOMEDIR}
eathena_start() {
if [ -x ${SRVHOMEDIR}/eathena-monitor ];
then echo "Starting eathena monitor..."
${SRVHOMEDIR}/eathena-monitor ${SRVHOMEDIR}/conf/eathena-monitor.conf
else echo "Eathena monitor binary is not executable or not found."
fi
}
eathena_stop() {
echo "Shutting down eathena monitor..."
killall eathena-monitor
}
eathena_restart() {
eathena_stop
echo "Waiting for all eathena processes to end..."
sleep 1
eathena_start
}
case "$1" in
'start')
eathena_start
;;
'stop')
eathena_stop
;;
'restart')
eathena_restart
;;
*)
echo "usage $0 start|stop|restart"
esac