diff --git a/restart.sh b/restart.sh old mode 100644 new mode 100755 index 5466c5f..84f9343 --- a/restart.sh +++ b/restart.sh @@ -1 +1,9 @@ -nohup python bin/kefu_robot.py >> bin/kefu_robot.out 2>&1 & +#!/bin/bash + +ps -ef|grep python|grep kefu_robot|grep -v grep +if [ $? -eq 0 ]; then + ps -ef|grep python|grep kefu_robot|grep -v grep|awk '{print $2}'|xargs kill -9 +fi + +cd bin +nohup python kefu_robot.py >> kefu_robot.out 2>&1 &