diff options
author | wizputer <wizputer@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-11-27 19:32:30 +0000 |
---|---|---|
committer | wizputer <wizputer@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-11-27 19:32:30 +0000 |
commit | 486b4f2a12b41507b67a1a93ae5871b3be447914 (patch) | |
tree | 8196d22d0fce973ac6e53b24735776ba9dcaf77f /tool/mapcheck.sh | |
parent | ecb15e6101bc1912bb2520151c45ed69af80feb8 (diff) | |
parent | f0da8da932031212f34aa97eff882f72cb69cc2a (diff) | |
download | hercules-486b4f2a12b41507b67a1a93ae5871b3be447914.tar.gz hercules-486b4f2a12b41507b67a1a93ae5871b3be447914.tar.bz2 hercules-486b4f2a12b41507b67a1a93ae5871b3be447914.tar.xz hercules-486b4f2a12b41507b67a1a93ae5871b3be447914.zip |
correct directory structure
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@387 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'tool/mapcheck.sh')
-rw-r--r-- | tool/mapcheck.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tool/mapcheck.sh b/tool/mapcheck.sh new file mode 100644 index 000000000..337884c43 --- /dev/null +++ b/tool/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 |