stopAppium.sh 423 B

12345678910111213141516171819202122
  1. #result=$(echo `netstat -nlp 2>/dev/null | grep node | grep $1`)
  2. #arr=(${result//,/ })
  3. #echo $arr
  4. #for i in ${arr[@]}
  5. #do
  6. # if [[ $i == *node ]]
  7. # then
  8. # tmp=$i
  9. # fi
  10. #done
  11. #process_id=${tmp%/*}
  12. #if [ -n $process_id ]
  13. #then
  14. # kill $process_id 2>/dev/null #不显示标准错误输出
  15. #fi
  16. #
  17. pid=$(echo `ps -ef | grep appium | grep $1 | grep node | awk '{print $2}'`)
  18. echo $pid
  19. if [ $pid ]
  20. then
  21. kill -9 $pid 2>/dev/null
  22. fi