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