Nice. A few weeks ago, I wrote a shell script similar to yours (yours
is more flexible), and also a Perl script which does the same thing
just for fun.  But all I really wanted was to read variables that are
set when the interface is started, so here's a question for the
variable-impaired: How can I make system variables (like IPADDR and
GATEWAY) available to a login shell?  "export" doesn't work that way;
surely there's a way to do this?

-d

Me wrote:

:Dan Browning wrote:
:> 
:> In a shell script, how do I assign a varialbe the current dynamic ip address
:> for a given interface?  What about current default gateway?
:
:
:LOCALIF="ppp0"
:
:LOCALIP=`ifconfig $LOCALIF | grep inet | cut -d : -f 2 | cut -d \  -f 1`
:LOCALMASK=`ifconfig $LOCALIF | grep Mask | cut -d : -f 4`
:LOCALNET="$LOCALIP/$LOCALMASK"
:echo "External: $LOCALNET
:
:--
:mozilla
:Be Counted ---> http://counter.li.org:80/index.html
:
:
:


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to