首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

shell脚本挟制进程重启

2013-10-18 
shell脚本强制进程重启while :doecho Current DIR is $PWDstillRunning$(ps -ef |grep $PWD/a.out |

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

热点排行