#!/bin/bash

workDir="/home/win88"

pkill -9 win88_gatesrv
pkill -9 win88_mgrsrv
pkill -9 win88_robot

pkill -2 win88_gamesrv
echo "================ gamesrv ==================="
echo "check gamesrv srv close state"
ps -ef | grep "win88"
echo "try close gamesrv..."
tail -f workDirgamesrv/all.log | awk '/shutdown/ {if(NR%10==0) {exit}; print}'
echo "Kill gamesrv"

pkill -2 win88_worldsrv
echo "================ worldsrv ==================="
echo "check worldsrv srv close state"
ps -ef | grep "win88"
echo "try close worldsrv..."
tail -f worldsrv/all.log | awk '/shutdown/ {if(NR%20==0) {exit}; print}'
echo "Kill worldsrv"

pkill -2 win88_dbproxy
echo "================ dbproxy ==================="
echo "check dbproxy srv close state"
ps -ef | grep "win88"
echo "try close dbproxy..."
tail -f dbproxy/all.log | awk '/shutdown/ {if(NR%1==0) {exit}; print}'
echo "Kill dbproxy"

pkill -9 win88_gamesrv
pkill -9 win88_worldsrv
pkill -9 win88_dbproxy
echo "check srv close state"
ps -ef | grep "win88"
