diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-08-10 01:01:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-08-10 01:01:34 +0300 |
commit | 5c0fc1fc767b7b447d787d8123b23e99a35b8577 (patch) | |
tree | 020ec097774629268481a47c98e70a53519057bc /herculeswrapper/map.sh | |
parent | 5b99ec96cf46a9a3b6687a7fbf8ef1d379d99f83 (diff) | |
download | tools-5c0fc1fc767b7b447d787d8123b23e99a35b8577.tar.gz tools-5c0fc1fc767b7b447d787d8123b23e99a35b8577.tar.bz2 tools-5c0fc1fc767b7b447d787d8123b23e99a35b8577.tar.xz tools-5c0fc1fc767b7b447d787d8123b23e99a35b8577.zip |
add herculeswrapper.
For now this is basic wrapper.
Allow:
terminate all servers
restart all servers
restart char and map servers
restart map server
Diffstat (limited to 'herculeswrapper/map.sh')
-rwxr-xr-x | herculeswrapper/map.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/herculeswrapper/map.sh b/herculeswrapper/map.sh new file mode 100755 index 0000000..ed2a1bd --- /dev/null +++ b/herculeswrapper/map.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +export PIPE=./log/mappipe.tmp +export LOGIN_PIPE=./log/loginpipe.tmp +export CHAR_PIPE=./log/charpipe.tmp + +source ${dir}/include.sh + +create_pipe + +while [ 1 ] ; do + ./map-server + export ret=$? + case "${ret}" in + 0) + echo "Returned 0. Probably ctrl+c" + break + ;; + 100) + echo "Terminating server" + send_all_pipes "exit" + break + ;; + 101) + echo "Restarting all servers..." + send_all_pipes "restart" + sleep 5s + ;; + 102) + echo "Restarting chat and map servers..." + send_char_pipe "restart" + sleep 3s + ;; + 103) + echo "Restarting map server..." + ;; + esac +done |