<HTML>
<HEAD>
<TITLE>Re: [hobbit] Port BB ext script to Hobbit</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>The </SPAN></FONT><SPAN STYLE='font-size:12.0px'><FONT COLOR="#333333"><FONT FACE="Lucida Grande, Verdana, Helvetica, Arial"><U>bb-raid-1_2b.sh </U>works out of the box with hobbit, along with the <U>bb-cpu2-3_9.sh</U> script<BR>
</FONT></FONT><FONT FACE="Verdana, Helvetica, Arial"><BR>
<BR>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"><B>From: </B>ZanDAhaR <allan@zandahar.net><BR>
<B>Reply-To: </B><hobbit@hswn.dk><BR>
<B>Date: </B>Mon, 05 Jun 2006 16:24:09 +1000<BR>
<B>To: </B><hobbit@hswn.dk><BR>
<B>Subject: </B>Re: [hobbit] Port BB ext script to Hobbit<BR>
<BR>
Henrik Stoerner wrote: <BR>
</FONT></SPAN><BLOCKQUOTE><SPAN STYLE='font-size:12.0px'><FONT FACE="Verdana, Helvetica, Arial"> <BR>
On Mon, Jun 05, 2006 at 11:01:49AM +1000, ZanDAhaR wrote:<BR>
  <BR>
 <BR>
</FONT></SPAN><BLOCKQUOTE><SPAN STYLE='font-size:12.0px'><FONT FACE="Verdana, Helvetica, Arial"> <BR>
This raid monitor script is the only one I managed to get working on one <BR>
of the boxes here so I'd prefer to stick with it. As far as I know the <BR>
script should be fine although the line where it execs bbedf.sh <BR>
obviously wont work so I'm assuming this is why the hobbitlaunch.cfg <BR>
sets the ENVFILE ?<BR>
    <BR>
 <BR>
</FONT></SPAN></BLOCKQUOTE><SPAN STYLE='font-size:12.0px'><FONT FACE="Verdana, Helvetica, Arial"> <BR>
<BR>
Correct. You could delete the BB setup lines if you like, but since they <BR>
are inside an 'if test "$BB..." = ""' section, it doesn't matter.<BR>
<BR>
I'm actually using this script on the Hobbit demo site :-) The only<BR>
things I've changed are really bugs in the script:<BR>
<BR>
  <BR>
 <BR>
</FONT></SPAN><BLOCKQUOTE><SPAN STYLE='font-size:12.0px'><FONT FACE="Verdana, Helvetica, Arial"> <BR>
#<BR>
TEST="raid"<BR>
RAID_DEVICES=`df -k | grep ^/dev/md | wc -l`<BR>
    <BR>
 <BR>
</FONT></SPAN></BLOCKQUOTE><SPAN STYLE='font-size:12.0px'><FONT FACE="Verdana, Helvetica, Arial"> <BR>
<BR>
Didn't work for me. I've changed that one to<BR>
  RAID_DEVICES=`grep "^md[0-9]*.*:" /proc/mdstat|wc -l`<BR>
<BR>
  <BR>
 <BR>
</FONT></SPAN><BLOCKQUOTE><SPAN STYLE='font-size:12.0px'><FONT FACE="Verdana, Helvetica, Arial"> <BR>
i=0<BR>
while [ "$i" -le "$RAID_DEVICES" ]<BR>
do<BR>
    <BR>
 <BR>
</FONT></SPAN></BLOCKQUOTE><SPAN STYLE='font-size:12.0px'><FONT FACE="Verdana, Helvetica, Arial"> <BR>
<BR>
This shows up three times in the script. It runs through<BR>
the loop one time too many, so I changed those three<BR>
occurrences to use "-lt" instead of "-le":<BR>
<BR>
  i=0<BR>
  while [ "$i" -lt "$RAID_DEVICES" ]<BR>
  do<BR>
<BR>
<BR>
Regards,<BR>
Henrik<BR>
<BR>
<BR>
To unsubscribe from the hobbit list, send an e-mail to<BR>
hobbit-unsubscribe@hswn.dk<BR>
<BR>
  <BR>
</FONT></SPAN></BLOCKQUOTE><SPAN STYLE='font-size:12.0px'><FONT FACE="Verdana, Helvetica, Arial">Ok well ill be buggered if I know whats going on, I tried those changes and I got a wc: broken pipe. So I put back the original file and it actually works now which is completely wacked.<BR>
<BR>
I'll have more of a play now that its actually working :)<BR>
<BR>
Cheers Henrik<BR>
<BR>
Allan<BR>
<BR>
</FONT></SPAN>
</BODY>
</HTML>