读书人

shell脚本挟制进程重启

发布时间: 2013-10-18 20:53:13 作者: rapoo

shell脚本强制进程重启

while :doecho "Current DIR is " $PWDstillRunning=$(ps -ef |grep "$PWD/a.out" |grep -v "grep")if [ "$stillRunning" ] ; thenecho "TWS service was already started by another way"echo "Kill it and then startup by this shell, other wise this shell will loop out this message annoyingly"kill -9 $pidof $PWD/a.outelseecho "TWS service was not started"echo "Starting service ..."$PWD/a.outecho "TWS service was exited!"fisleep 10done

读书人网 >编程

热点推荐