#!/bin/sh #杀死进程 result=1 if [ -e run.pid ] then p=`cat run.pid` kill $p if [ $? -eq 0 ] then echo "成功杀死进程:$p" rm -f run.pid else echo "无法杀死进程:$p" result=0 fi fi if [ $result -eq 1 ] then ./run.sh fi