杀掉进程并重启

上一篇 / 下一篇  2014-03-07 17:49:28 / 个人分类:linux

#!/bin/bash


if test $( pgrep -f $myfile | wc -l ) -gt 0
then 
    echo "process has  start, it will be killed...." 
    pkill $myfile
    echo "killed kernerl2.1"
else 
    
    if [ ! -f "$myfile" ]; then
        echo "file $myfile is not exist!"
        echo "$myfile start fail"
        exit
    else
        cp $myfile /usr/local/007ka/bazi/PaiPan2.0/Newbazi
    fi

fi
cd /usr/local/007ka/bazi/PaiPan2.0/Newbazi
nohup ./$myfile run &>/dev/null &

TAG:

 

评分:0

我来说两句

Open Toolbar