#!/bin/bash ps -ef|grep python|grep game1009newlogger|grep -v grep if [ $? -eq 0 ]; then ps -ef|grep python|grep game1009newlogger|grep -v grep|awk '{print $2}'|xargs kill -9 fi cd bin nohup python game1009newlogger.py >> game1009newlogger.out 2>&1 &