github.com/aergoio/aergo@v1.3.1/consensus/impl/raftv2/test/kill_svr.sh (about) 1 #!/usr/bin/env bash 2 # usage: $0 [bpprefix] 3 # help : kill.sh BP11 4 5 pattern=$1 6 7 if [ $# -gt 1 ]; then 8 echo "Usage: $0 pattern(ex:BP11001)" 9 fi 10 11 if [ $# -eq 0 ]; then 12 pattern="BP" 13 fi 14 15 echo "kill $pattern" 16 for i in $(ps -ef| grep aergosvr | grep "BP"| grep "$pattern" | awk '{ print $2 }') 17 do 18 if [ $i -gt 0 ]; then 19 echo "kill -9 $i" 20 kill -9 $i 21 fi 22 done 23 24 sleep 3 25 echo "remain processes..." 26 echo "$(ps -ef| grep aergosvr | grep BP | grep -v grep)" 27 echo "done" 28