summaryrefslogtreecommitdiff
path: root/tool/mapchecker.sh
diff options
context:
space:
mode:
author(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-04 23:25:09 +0000
committer(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-04 23:25:09 +0000
commit195dffc20af1fb32c7e4119988911b72955aeabc (patch)
treeb60d2a5e72d64dc5fc21eb9ce0962631e774a4c9 /tool/mapchecker.sh
downloadhercules-195dffc20af1fb32c7e4119988911b72955aeabc.tar.gz
hercules-195dffc20af1fb32c7e4119988911b72955aeabc.tar.bz2
hercules-195dffc20af1fb32c7e4119988911b72955aeabc.tar.xz
hercules-195dffc20af1fb32c7e4119988911b72955aeabc.zip
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@2 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'tool/mapchecker.sh')
-rw-r--r--tool/mapchecker.sh56
1 files changed, 56 insertions, 0 deletions
diff --git a/tool/mapchecker.sh b/tool/mapchecker.sh
new file mode 100644
index 000000000..5f26c9d4b
--- /dev/null
+++ b/tool/mapchecker.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+athena_dir="/home/athena/658/"
+
+while [ true ] ; do
+
+if [ ` ps fauxw | grep map-server | grep -v grep | wc -l ` -eq 0 ];then
+ #echo `date` " -- map-server crashed - restarting"
+ echo `date` " -- map-server crashed - restarting" >> /var/log/athena_status.log
+ killall -9 map-server
+ cd $athena_dir
+ nohup ./map-server ./conf/map_athena.conf ./inter_athena.conf &
+ sleep 240
+ #sleep 40 #for fast pc's remove the "#" at the beginning of the line and delete the line above
+fi
+
+
+if [ ` ps fauxw | grep map-server | grep -v grep | awk '{print $3}' | awk 'BEGIN{FS="."} {print $1}' ` -gt 10 ];then
+ #echo `date` " -- mapserver cpuload over 10 - restarting"
+ echo `date` " -- mapserver cpuload over 10 - restarting" >> /var/log/athena_status.log
+ killall -9 map-server
+ cd $athena_dir
+ nohup ./map-server ./conf/map_athena.conf ./inter_athena.conf &
+ sleep 240
+ #sleep 40 #for fast pc's remove the "#" at the beginning of the line and delete the line above
+ #echo `date` " -- restarted"
+ echo `date` " -- restarted" >> /var/log/athena_status.log
+fi
+
+if [ ` ps fauxw | grep char-server | grep -v grep | wc -l ` -eq 0 ];then
+ #echo `date` " -- char server crashed - restarting"
+ echo `date` " -- char server crashed - restarting" >> /var/log/athena_status.log
+ killall -9 char-server
+ cd $athena_dir
+ nohup ./char-server ./conf/char_athena.conf ./conf/inter_athena.conf &
+ #echo `date` " -- restarted"
+ echo `date` " -- restarted" >> /var/log/athena_status.log
+
+fi
+
+if [ ` ps fauxw | grep login-server | grep -v grep | wc -l ` -eq 0 ];then
+ #echo `date` " -- login server crashed - restarting"
+ echo `date` " -- login server crashed - restarting" >> /var/log/athena_status.log
+ killall -9 login-server
+ cd $athena_dir
+ nohup ./login-server ./conf/login_athena.conf &
+ #echo `date` " -- restarted"
+ echo `date` " -- restarted" >> /var/log/athena_status.log
+
+fi
+
+
+#echo `date` " -- everything is fine"
+echo `date` " -- everything is fine" >> /var/log/athena_status.log
+sleep 30
+done