summaryrefslogtreecommitdiff
path: root/eathena.sh
diff options
context:
space:
mode:
authorZuzanna K. Filutowska <platyna@users.sourceforge.net>2006-03-10 21:49:08 +0000
committerZuzanna K. Filutowska <platyna@users.sourceforge.net>2006-03-10 21:49:08 +0000
commitdf5e39fac087fb59a6ffbf2c36d30560954ce2d9 (patch)
tree7126222b4aac67020ece5d658e7f75fa7d3c15bc /eathena.sh
parent23b3087230160c6b7b5eb15ada36878372fb61a1 (diff)
downloadserverdata-df5e39fac087fb59a6ffbf2c36d30560954ce2d9.tar.gz
serverdata-df5e39fac087fb59a6ffbf2c36d30560954ce2d9.tar.bz2
serverdata-df5e39fac087fb59a6ffbf2c36d30560954ce2d9.tar.xz
serverdata-df5e39fac087fb59a6ffbf2c36d30560954ce2d9.zip
Adopted athena.sh script to locally control eAthena processes (start/stop/restart the eathena-monitor when needed so there is no need of root access anymore).
Diffstat (limited to 'eathena.sh')
-rwxr-xr-xeathena.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/eathena.sh b/eathena.sh
new file mode 100755
index 00000000..b6cbbc14
--- /dev/null
+++ b/eathena.sh
@@ -0,0 +1,52 @@
+#!/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 <platyna@platinum.linux.pl>
+# 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()
+
+cd ${SRVHOMEDIR}
+
+eathena_start() {
+ if [ -x ${SRVHOMEDIR}/eathena-monitor ];
+ then echo "Starting eathena monitor..."
+ ${SRVHOMEDIR}/eathena-monitor
+ 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 5
+ eathena_start
+}
+
+case "$1" in
+'start')
+ eathena_start
+ ;;
+'stop')
+ eathena_stop
+ ;;
+'restart')
+ eathena_restart
+ ;;
+*)
+ echo "usage $0 start|stop|restart"
+esac