以前是用进程来做的,现在用SHELL来做,目的:把引导文件离要启动的模块实时监测已启动的进程里有没有
如果没有,则启动
while sleep 10
do
grep /& /prog/init/run.sh|awk -F"#./" '{print $1}'|grep /&|awk -F"&" '{print $1}'>runmodule
aa=`grep -c ./ runmodule`
x=1
while [ "$x" -le "$aa" ]
do
cmpmodule=`sed -n $x"p" runmodule`
sed -n $x"p" runmodule>proc_wnc
grep wnc proc_wnc
if [ $? -ne 0 ];then
ps|grep $cmpmodule |grep -v grep>shtmp
else
bb=`awk -F" " '{ print $2}' proc_wnc`
ps |grep ./wnc/ $bb|grep -v grep>shtmp
fi
if [ $? -ne 0 ];then
$cmpmodule&
fi
x=$(($x+1))
done
done