You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#!/bin/sh
|
|
#杀死进程
|
|
result=1
|
|
if [ -e run.pid ]
|
|
then
|
|
p=`cat run.pid`
|
|
kill -9 $p
|
|
if [ $? -eq 0 ]
|
|
then
|
|
echo "成功杀死进程:$p"
|
|
rm -f run.pid
|
|
else
|
|
echo "无法杀死进程:$p,重启$1失败"
|
|
result=0
|
|
fi
|
|
fi
|
|
|
|
if [ $result -eq 1 ]
|
|
then
|
|
echo "执行$1的运行脚本`pwd`/run.sh"
|
|
./run.sh
|
|
echo "执行$1的运行脚本`pwd`/run.sh,exit code:$?"
|
|
fi
|
|
|