Christian Knappke wrote
>
> "Colin Bull" <c.bull@videonetworks.com> wrote:
>
> > Here is one I prepared earlier ---
> >
> > onbar/ontape whatever ..
> > FORCEOL=n
> > until onstat - | grep "On-Line" > /dev/null
> > do
> > echo "Off line" # ; sleep 20
> > onstat - | grep "[BQ][lu][oi][ce][ks]" > /dev/null && ( echo
> > "\nServ blokd"
> > if [ x$FORCEOL = "xn" ] ; then
> > echo "Onlining.." ; onmode -m ; FORCEOL=y;
> > sleep 240
> > else
> > echo "waiting to online " ; sleep 240
> > fi
> > )
> > onstat - # for comfort factor
> > sleep 60
> > done
> 'onstat -' sets the return code according to the server state ->
> no need for boll*cking greps...
>
> >From the top of my head:
> 255 = server is offline ("Shared memory not initialized...")
> 5 = online
> 4 = some error
> 0..3 = several other states like quiescent, blocked etc. (don't
> know exacly)
>
That will make it a lot tidier, should be able to use a case statement.
I will revise next week sometime.
Colin Bull
c.bull@videonetworks.com
sending to informix-list