View Single Post
  #1   (View Single Post)  
Old 2nd October 2008
Sunnz's Avatar
Sunnz Sunnz is offline
Real Name: I don't have real time
Just a computer user...
 
Join Date: May 2008
Location: See Google Maps
Posts: 101
Default Reliable method to get an IP?

OK I have a few pppoe connections... which can be viewed on the command line by `ifconfig pppoe0` `ifconfig pppoe1` and so on...

I was wondering what's the most reliable way to get the IP address of them?

They all have different dynamic IP and changes over time... I want a way to detect the changes...

I was thinking of writing a python script that parses the output of `ifconfig pppoeX` and grab the IP address, compare to the one if had before.

The python script would need to be run as a cron job... maybe every 10 minutes, or every hour.

Are there any better way to do this? in pf rules one can do something like (pppoe) which seems to be more "event driven", when the changes occur it notifies pf somehow...

If there are more effective way that is "event driven" like so that I don't need to run a cron job, I don't mind if it had to be written in C or something... as long as it exist...

Cheers.
__________________
She sells C shells by the seashore.
Reply With Quote