12345678910111213141516171819202122232425 |
- #!/bin/sh
- echo "begin restart..."
- cd ../
- PROCESS=`pwd | xargs -i basename {}`
- COUNT=`ps -ef|grep "\./$PROCESS"|grep -v grep|wc -l`
- if [ $COUNT -lt 1 ]; then
- echo "process $PROCESS not exist!"
- fi
- PID=`ps -ef | grep "$PROCESS" | grep -v grep | grep -v awk | awk '{print $2}'`
- echo "kill -HUP ${PID}"
- kill -HUP ${PID}
- if [ $? != "0" ]; then
- echo "Restart $PROCESS Failed."
- exit 1
- else
- echo "Restart $PROCESS OK."
- exit 0
- fi
|