From a039fe29253dc5ef38e9741d17fbf44a1415bb17 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 30 Jan 2019 10:55:30 +0800 Subject: [PATCH] 1 --- restart.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) mode change 100644 => 100755 restart.sh 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 &