[ale] "busybox" looping?

Robert L. Harris Robert.L.Harris at rdlg.net
Tue Dec 17 09:51:28 EST 2002



  Anyone use busybox?  Yes, I'm reverse engineering yet another project
since the last one started rolling out finally.  It's a custom boot
floppy that uses busybox.  The only real problem aside from some
modernization and tweaking is that the floppy executes a "menu" which
defaults to a very bad option if it doesn't like what it gets.  I'm
thinking I'd like to put in a loop.  Right now it has a case statement
that does a:

echo "** Entering bootstrap **"
echo -n "Obtain ip via DHCP? (default: yes):  "
read DHCP*

case $DHCP in*
        [Nn][Oo] | [Nn])
                /sbin/manual_IP
        ;;
        *)
                echo -n "Starting dhclient: "
                dhclient && echo "Success." || /sbin/manual_IP
        ;;
esac

  The problem is that none of our production servers have dhcp in their
area so we have to manually enter the IP.  If you're connecting to a
remote console though you have to hit "enter" to get a screen refresh
when it disconnects you at boot up/reboot.  As a result you may or may
not end up hitting enter instead of "no" at that prompt.  It's happened
with co-workers a few times in the very early hours of the morning.

  I know I can put a bunch of read's before the segment but I'd like to
make it a little smarter and have it explicitly look for "yes" and loop
back if no such animal.

  Anyone used busy box to this end or other good suggestions?  No dhcp
won't be installed in the remote areas.. :>

Robert


:wq!
---------------------------------------------------------------------------
Robert L. Harris                     | PGP Key ID: FC96D405
                               
DISCLAIMER:
      These are MY OPINIONS ALONE.  I speak for no-one else.
FYI:
 perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'


 PGP signature




More information about the Ale mailing list