diff options
author | Zuzanna K. Filutowska <platyna@users.sourceforge.net> | 2006-02-21 22:15:05 +0000 |
---|---|---|
committer | Zuzanna K. Filutowska <platyna@users.sourceforge.net> | 2006-02-21 22:15:05 +0000 |
commit | 5b8d1b4f20a117e071e4ab57bd16be3215c20a06 (patch) | |
tree | 3f30e2ac87f1d8ba29c690a3f1f375d399d94362 /athena.sh | |
parent | 951d8a7523e75a90996c4bf6bf30796cd1142135 (diff) | |
download | serverdata-5b8d1b4f20a117e071e4ab57bd16be3215c20a06.tar.gz serverdata-5b8d1b4f20a117e071e4ab57bd16be3215c20a06.tar.bz2 serverdata-5b8d1b4f20a117e071e4ab57bd16be3215c20a06.tar.xz serverdata-5b8d1b4f20a117e071e4ab57bd16be3215c20a06.zip |
Initial revision
Diffstat (limited to 'athena.sh')
-rwxr-xr-x | athena.sh | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/athena.sh b/athena.sh new file mode 100755 index 00000000..51fe8b24 --- /dev/null +++ b/athena.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +# $Id$ +#---------------------------------------------------------------------- +# Description: eAthena dameon control script. +# 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} + +athena_start() { + if [ -x ${SRVHOMEDIR}/login-server ]; + then echo "Starting login server..." + ${SRVHOMEDIR}/login-server > ${SRVHOMEDIR}/log/login-server-startup.log 2>&1 & + else echo "Login server binary is not executable or not found." + fi + + if [ -x ${SRVHOMEDIR}/char-server ]; + then echo "Starting char server..." + ${SRVHOMEDIR}/char-server > ${SRVHOMEDIR}/log/char-server-startup.log 2>&1 & + else echo "Character server binary is not executable or not found." + fi + + if [ -x ${SRVHOMEDIR}/map-server ]; + then echo "Starting map server..." + ${SRVHOMEDIR}/map-server > ${SRVHOMEDIR}/log/map-server-startup.log 2>&1 & + else + echo "Map server binary is not executable or not found." + fi +} + +athena_stop() { + echo "Shutting down login server..." + killall login-server + echo "Shutting down char server..." + killall char-server + echo "Shutting down map server..." + killall map-server +} + +athena_restart() { + athena_stop + echo "Waiting for all processes to end..." + sleep 10 + athena_start +} + +case "$1" in +'start') + athena_start + ;; +'stop') + athena_stop + ;; +'restart') + athena_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac |