#!/bin/bash
echo "" >/tmp/receve_pid.txt
/bin/ps ax | /bin/grep "receve.sh" | /bin/grep -v "grep" | /bin/
linuxjishu/13830.html target=_blank class=infotextkey>awk '{print $1}' >/tmp/receve_pid.txt
no1pid=`cat /tmp/receve_pid.txt | sort -r`
no2pid=`cat /usr/local/scripts/phpshell/receve.sid | sort -r`
if [ -z $no1pid ];then
        echo  "receve.sh pid is null, receve.sh is not running."
    else        
        /bin/kill -9 "$no1pid"        
        echo "receve.sh killed"
fi
sleep 3
if [ -z $no2pid ];then
        echo  "receve.php pid is null, receve.php is not running."
    else
        /bin/kill -9 "$no2pid"
        echo "receve.php killed"
fi
rm -rf /usr/local/scripts/phpshell/receve.sid 
sleep 3 
/usr/local/scripts/receve.sh > /dev/null &