[lug] Newbie tries to make laptop modem work

Glenn Murray gmurray at Mines.EDU
Tue Dec 11 13:19:13 MST 2001


Ken,

This works well to pick out the assigned address!  I can figure out
the sed part to replace a host IP address in an ipchains script, but I
don't know how to handle the waiting-for-the-connection part in a
shell script.  If you or other readers can help me put one together
I'll put it up on my website, but wouldn't it be easier to use
http://www.tummy.com/isinglass/ than reinventing the wheel here?


I imagine a skeleton for a dial-isp.sh script which used a
ip-firewall.sh script as a base would be:

#
wvdial &
# wait for connection...
?
#
# Get assigned IP addr
IP_ADDR=/sbin/ifconfig|fgrep -C eth0|fgrep .... (as below)
#
# Insert IP_ADDR into ipchains script ip-firewall.sh
? sed or tr here >/tmp/tmp-firewall.sh
# 
# Remove old firewall
/etc/init.d/ip-firewall.sh stop
#
# Start new firewall
/tmp/tmp-firewall.sh

Thanks.
Glenn Murray
www.mines.edu/~gmurray/public_html/Welcome.html

On Fri, 7 Dec 2001, Ken Weinert wrote:
...> 
> Well, I can't guarantee this is the most efficient way to do it, but
> a) it works, and b) I didn't find an already established way to do it
> :)
> 
> /sbin/ifconfig|fgrep -C eth0|fgrep "inet addr" | tr -s ' ' |cut -d: -f2|cut -d' ' -f1
> 
> -- 
> Ken Weinert   kenw at ihs.com 303-858-6956 (V) 303-705-4258 (F)
> GnuPG KeyID: 9274F1CE           GnuPG available at http://www.gnupg.org/
> GnuPG Key Fingerprint: 1D87 3720 BB77 4489 A928  79D6 F8EC DD76 9274 F1CE
> Linux 2.2.14: up 34 days, 18:19
> DOS Tip #17: Add DEVICE=FNGRCROS.SYS to CONFIG.SYS
> 
> 




More information about the LUG mailing list