[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: use of 'cut' to pull dynamic IPADDR from ifconfig done



Tom et al.
  I am able to get it going now.  I was confused on how to
use a blank space as a delimiter and cout not find the
reference to the '\' as a delimiter.  It now works for
capturing the new IP address when I dial into my ISP. 
Firewall is now working and maybe I won't get hacked for a
while.

  Is the use of the '\' as a delimiter part of the bash
shell scripting?  I am presuming this since it isn't
mentioned in the man page.

  Thanks everyone for your help with getting my box
reinstalled,upgraded, and recompiled; diald running again
even though portions are not mentioned in the HOWTO [I
figured out that a lot of new stuff has been added for ISDN
and other POTS dial-up connections; and with the scripting
necessary to dynamically pull the new IP address each time
ip-up fires.

  MERRY CHRISTMAS!!

Bob Hartung
"Burke, Thomas G." wrote:
> 
> >From my firewall:
> 
> EXTERNAL_IF=ppp0
> #
> #   These lines for dynamic IP
>  EXTERNAL_IP=`ifconfig $EXTERNAL_IF | grep inet | cut -d : -f 2 | cut -d \
> -f 1`
>  EXTERNAL_MASK=`ifconfig $EXTERNAL_IF | grep Mask | cut -d : -f 4`
> #
> EXTERNAL_NET=$EXTERNAL_IP/$EXTERNAL_MASK
> echo -n "External net -> "
> echo $EXTERNAL_NET
> 
> > -----Original Message-----
> > From: Eddie Strohmier [SMTP:estroh earthlink net]
> > Sent: Friday, December 22, 2000 1:20 PM
> > To:   redhat-list redhat com
> > Subject:      Re: use of 'cut' to pull dynamic IPADDR from ifconfig
> >
> > Charles:
> >
> > You apparently did not read the whole message. I was trying to help Bob
> > Hartung from a previous post who is trying to get cut to pull a dynamic IP
> > address from ifconfig. I am not a scripter just a 4 1/2 year Linux user. I
> > thought he might be able to work with this one to employ cut. Give him a
> > hand if you can. Here is his original post if you don't have it:
> > _________________________
> >
> > Hi,
> >   Progress slow but sure.  Got everything running withh
> > diald - not sure why it works but it does.  There was
> > recently a message using grep, cut and ifconfig output to
> > pluck a dynamically assigned IP address to use in
> > firewalls.  Does someone have the message.  I can get it to
> > xxx.xxx.xxx.xxx Bcast but can't figure out the last cut
> > where the delimiter is a blank.
> >
> >   Thanks
> >
> > Bob
> >
> > _____________________________
> >
> >
> > Eddie Strohmier
> >
> >
> >
> > ----- Original Message -----
> > From: "Charles Galpin" <cgalpin lighthouse-software com>
> > To: <redhat-list redhat com>
> > Sent: Friday, December 22, 2000 8:24 AM
> > Subject: Re: use of 'cut' to pull dynamic IPADDR from ifconfig
> >
> >
> > > Wooah Eddie!!
> > >
> > > You can handle this in several ways better than this. Both pump amd
> > dhcpcd
> > > provide hooks to scripts that will run when the lease is renewed,
> > changed
> > > etc.
> > >
> > > Tell us which one you are using, nad I can provide more details.
> > >
> > > And, even emailing it to you isn't as convenient as say ftping a html
> > page
> > > to some place with your latest ip on it.
> > >
> > > Then a free dynamic Ip service is probably the ultimate, but I can't
> > > suggest one - I was using dynodns, but it got ?bought? by deerfield, so
> > > I'm assuming is not free anymore.
> > >
> > > Anything but getting an email every 10 minutes (even if it's handled by
> > a
> > > procmail script) - ugh.
> > >
> > > charles
> > >
> > > On Fri, 22 Dec 2000, Eddie Strohmier wrote:
> > >
> > > > Bob:
> > > >
> > > > A "Chris Dowling" was kind enough to share this for some other
> > subscriber to
> > > > this list. I have been looking for a script of this sort for a while
> > as
> > what
> > > > I had been doing before was getting cron to e-mail me every hour so I
> > know
> > > > the IP address of network server on a dynamic dialup ISP.  His script
> > does
> > > > not use cut but I bet cut could be utilized in some way here to
> > achieve
> > what
> > > > you need. Here is the script:
> > > >
> > > > ifconfig ppp0 | grep 'inet addr' | awk -F: '{ print $2 } ' | awk '{
> > print
> > > > $1 } ' | mail -s 'ip address' user domain com
> > > >
> > > > Eddie Strohmier
> > >
> > >
> > >
> > > _______________________________________________
> > > Redhat-list mailing list
> > > Redhat-list redhat com
> > > https://listman.redhat.com/mailman/listinfo/redhat-list
> > >
> >
> >
> >
> > _______________________________________________
> > Redhat-list mailing list
> > Redhat-list redhat com
> > https://listman.redhat.com/mailman/listinfo/redhat-list
> 
> _______________________________________________
> Redhat-list mailing list
> Redhat-list redhat com
> https://listman.redhat.com/mailman/listinfo/redhat-list

-- 
Bob Hartung
www.radiologygrouppc.com
www.qchealthwatch.com





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]