Skip to Content.
Sympa Menu

baslinux - Re: [BL] dhcp vs static network addressing

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: qwms-avib AT dea.spamcon.org
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] dhcp vs static network addressing
  • Date: Sat, 24 May 2003 18:02:53 +0000

> ---------------------------------------------
> select i in home work school; do
> case $i in home) ifconfig eth0 192.168.1.3 ;;
> work) ifconfig eth0 404.97.36.9 ;;
> school) dhcp ;;
> *) echo "THAT DOES NOT COMPUTE"
> esac;break;done
> ---------------------------------------------
>
> Of course you could do a fancier menu (with error
> trapping) using echo and read, but select works OK.

OK, here is a version done with echo/read instead of
select. It's not fancy, but you could use additional
echo lines to make a nicer menu.
---------------------------------------------
echo -e "(1) home\n(2) work\n(3) school"
read i
case $i in 1) ifconfig eth0 192.168.1.3 ;;
2) ifconfig eth0 404.97.36.9 ;;
3) dhcp eth0 ;;
*) echo "THAT DOES NOT COMPUTE"
esac
---------------------------------------------

Cheers,
Steven





Archive powered by MHonArc 2.6.24.

Top of Page