From 620e60eebce2c1f35c5c9a82f6ca365b316587f5 Mon Sep 17 00:00:00 2001 From: Valaris Date: Sun, 29 Jan 2006 16:10:48 +0000 Subject: AS OF SVN REV. 5901, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EVERYTHING ELSE GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5094 54d463be-8e91-2dee-dedb-b68131a5f0ec --- tools/mapchecker.sh | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 tools/mapchecker.sh (limited to 'tools/mapchecker.sh') diff --git a/tools/mapchecker.sh b/tools/mapchecker.sh new file mode 100644 index 000000000..5f26c9d4b --- /dev/null +++ b/tools/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 -- cgit v1.2.3-60-g2f50