[ale] "busybox" looping?

James P. Kinney III jkinney at localnetsolutions.com
Tue Dec 17 11:33:51 EST 2002


"Please enter your 512 character security ID code at the prompt. If you
make a mistake, you will be fired. If you attempt to use the backspace
key, you will be fired. If you use the delete key, you will be fired. If
you would like to try this process again and FOLLOW THE SIMPLE
DIRECTIONS, please hit the enter key and nothing else, or you will be
fired. Have a nice day."

On Tue, 2002-12-17 at 11:03, Robert L. Harris wrote:
> This one would work.  Could tell the person something "ok, learn to type
> and then execute "setup" to try again...
> 
> 
> Thus spake James P. Kinney III (jkinney at localnetsolutions.com):
> 
> > Oh. My syntax is, I'm sure, crappy, the idea is there. As long as DHCP
> > is blank, loop through the process, setting DHCP to NULL if not in good
> > form.
> > 
> > 
> > echo "** Entering bootstrap **"
> >  while ( ! DHCP ){
> >  nums=0123456789
> >  
> >  echo -n "Enter IP address or DHCP:  "
> >  read DHCP*
> >  
> >  case $DHCP in*
> >          [$nums]\.[$nums])
> >                  /sbin/manual_IP 
> >          ;;
> > 	[Dd][Hh][Cc][Pp])
> > 		echo -n "Starting dhclient: "
> >                  dhclient && echo "Success." || /sbin/manual_IP
> > 	;;
> >          *)
> >                 DCHP=""
> > 		echo "I can't start networking with that input" 
> > 		exit
> >          ;;
> >  esac
> > }
> > 
> > On Tue, 2002-12-17 at 10:14, Robert L. Harris wrote:
> > >   Problem is that if the remote console (tty consoles in offices in and
> > > out of the country) is slow and you hit enter to get the console to
> > > respond, it doesn't because of lag, you hit enter again thinking it
> > > wasn't connected, you just started dhclient and hosed the box.
> > > 
> > > 
> > > 
> > > Thus spake James P. Kinney III (jkinney at localnetsolutions.com):
> > > 
> > > > Change the default to:
> > > > 
> > > > echo "** Entering bootstrap **"
> > > > 
> > > > nums=0123456789
> > > > 
> > > > echo -n "Enter IP address (leave blank for DHCP):  "
> > > > read DHCP*
> > > > 
> > > > case $DHCP in*
> > > >         [$nums]\.[$nums])
> > > >                 /sbin/manual_IP 
> > > >         ;;
> > > >         *)
> > > >                 echo -n "Starting dhclient: "
> > > >                 dhclient && echo "Success." || /sbin/manual_IP
> > > >         ;;
> > > > esac
> > > > 
> > > > On Tue, 2002-12-17 at 09:51, Robert L. Harris wrote:
> > > > >   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);'
> > > > -- 
> > > > James P. Kinney III   \Changing the mobile computing world/
> > > > President and CEO      \          one Linux user         /
> > > > Local Net Solutions,LLC \           at a time.          /
> > > > 770-493-8244             \.___________________________./
> > > > 
> > > > GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics) <jkinney at localnetsolutions.com>
> > > > Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7 
> > > > 
> > > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > :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);'
> > -- 
> > James P. Kinney III   \Changing the mobile computing world/
> > President and CEO      \          one Linux user         /
> > Local Net Solutions,LLC \           at a time.          /
> > 770-493-8244             \.___________________________./
> > 
> > GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics) <jkinney at localnetsolutions.com>
> > Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7 
> > 
> > 
> 
> 
> 
> 
> 
> :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);'
-- 
James P. Kinney III   \Changing the mobile computing world/
President and CEO      \          one Linux user         /
Local Net Solutions,LLC \           at a time.          /
770-493-8244             \.___________________________./

GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics) <jkinney at localnetsolutions.com>
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7 



 This is a digitally signed message part




More information about the Ale mailing list