summaryrefslogtreecommitdiff
path: root/start
diff options
context:
space:
mode:
authorDracoRPG <DracoRPG@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-23 22:05:28 +0000
committerDracoRPG <DracoRPG@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-23 22:05:28 +0000
commite806cbbaa63804c9f4ff2a82e20789d784a93b11 (patch)
tree36d70e3146b35c78ce3a6a5a59f129b4589d2b9d /start
parent8dacd1b99602cf87a11bb5e2f12778b7ba783f6d (diff)
downloadhercules-e806cbbaa63804c9f4ff2a82e20789d784a93b11.tar.gz
hercules-e806cbbaa63804c9f4ff2a82e20789d784a93b11.tar.bz2
hercules-e806cbbaa63804c9f4ff2a82e20789d784a93b11.tar.xz
hercules-e806cbbaa63804c9f4ff2a82e20789d784a93b11.zip
Updated Unix start scripts from Shazeya, please read changelog for details
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11070 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'start')
-rw-r--r--start112
1 files changed, 35 insertions, 77 deletions
diff --git a/start b/start
index 82cfb7a40..b92fb56df 100644
--- a/start
+++ b/start
@@ -1,77 +1,35 @@
-#!/bin/sh
-
-# Athena自動再起動スクリプト
-#
-# [USAGE] ./start
-#
-# 既にAthenaを起動した状態では実行しないで下さい。
-# サーバーの状態を確認するスクリプトが動作するので、シェルに戻りません。
-# Athenaを止めたいときは Ctrl+C で終了してください。
-# 
-# もしくは ./start & としてバックグラウンドで起動すると
-# シェルに戻ってきますが、サーバーの停止が少し面倒です。
-
-L_SRV=./bin/login-server
-C_SRV=./bin/char-server
-M_SRV=./bin/map-server
-
-process_check() {
- # check login server
- if [ ! -f ${L_SRV}.pid ]; then
- login=0
- else
- login=`cat ${L_SRV}.pid`
- login=$(ps ax | grep "${L_SRV}" | grep "${login}" | wc -l)
- fi
-
- # check char server
- if [ ! -f ${C_SRV}.pid ]; then
- char=0
- else
- char=`cat ${C_SRV}.pid`
- char=$(ps ax | grep "${C_SRV}" | grep "${char}" | wc -l)
- fi
-
- # check map server
- if [ ! -f ${M_SRV}.pid ]; then
- map=0
- else
- map=`cat ${M_SRV}.pid`
- map=$(ps ax | grep "${M_SRV}" | grep "${map}" | wc -l)
- fi
-
- # echo "check: ${login} ${char} ${map}"
- echo `expr ${login} + ${char} + ${map}`
-}
-
-if [ `process_check` -ne 0 ]; then
- echo "Athena is already running..."
-else
- ./athena-start start
- sleep 30
-
- while true
- do
- if [ `process_check` -lt 3 ]; then
- printf "Error:"
- date
- sleep 10
- printf "Checking:"
- date
- if [ `process_check` -lt 3 ]; then
- printf "Error Confirmation:"
- date
- printf "Restoration:"
- date
- ./athena-start restart
- else
- printf "Check Miss Sorry:"
- date
- fi
- #else
- # printf "Check OK:"
- # date
- fi
- sleep 10
- done
-fi
+#!/bin/bash
+# modified by shazeya@syafi.com (NL130240)
+
+./athena-start start
+sleep 30
+
+while [ true ]; do
+ if [ " 0" = "$(ps | grep -e log | wc -l)" ] ||
+# if [ " 0" = "$(ps | grep -e login | wc -l)" ] ||
+ [ " 0" = "$(ps | grep -e char | wc -l)" ] ||
+ [ " 0" = "$(ps | grep -e map | wc -l)" ]; then
+ printf "Error:"
+ date
+ sleep 10
+ printf "Checking:"
+ date
+ if [ " 0" = "$(ps | grep -e log | wc -l)" ] ||
+# if [ " 0" = "$(ps | grep -e login | wc -l)" ] ||
+ [ " 0" = "$(ps | grep -e char | wc -l)" ] ||
+ [ " 0" = "$(ps | grep -e map | wc -l)" ]; then
+ printf "Error Confirmation:"
+ date
+ printf "Restoration:"
+ date
+ ./athena-start start
+ else
+ printf "Check Miss Sorry:"
+ date
+ fi
+# else
+# printf "Check OK:"
+# date
+ fi
+ sleep 10
+done