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/mapcheck.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tools/mapcheck.sh (limited to 'tools/mapcheck.sh') diff --git a/tools/mapcheck.sh b/tools/mapcheck.sh new file mode 100644 index 000000000..54cdd0765 --- /dev/null +++ b/tools/mapcheck.sh @@ -0,0 +1,34 @@ +#!/bin/sh +echo "============================================" +echo "= map server status checker... =" +echo "============================================" +./map-server.exe & +sleep 40 + +while [ 0 ] +do + pcpu=` top -n 1| grep map-server | awk '{print $9}' | awk 'BEGIN{FS="."} {print $1}' ` + if [ "$pcpu" -gt 80 ];then + echo "============================================" + echo "map server is more than 80% (now $pcpu%)" + echo "============================================" + ppid=` ps -a | grep map-server | awk '{print $1}' ` + kill $ppid + ./map-server.exe & + sleep 40 + else + pmapct=` ps -a| grep map-server | wc -l ` + if [ "$pmapct" -eq 0 ];then + echo "============================================" + echo "map server is not running..." + echo "restart map server..." + echo "============================================" + ./map-server.exe & + sleep 40 + #echo "test" + else + echo "map server is ok (now $pcpu%)..." + sleep 5 + fi + fi +done \ No newline at end of file -- cgit v1.2.3-70-g09d2