Re: ppp <- zugewiesene IP auslesen

From: Stefan Weißwange <sweisswange(at)GMX.de>
Date: Tue, 13 May 2003 22:39:21 +0200

Am 13.05.2003 22:21 schrieb Andy Tschiersch:

> wie kann ich rausfinden welche IP ich von meinem ISP zugewiesen
> bekommen habe wenn ich mich mit ppp eingewählt habe?

Hi...

Also ich hab'S so gemacht, geht aber sicher noch eleganter ;-)

--- schnipp ---

open(README, "ifconfig tun0 |") or
        logfile( "error: Can't run ifconfig: $!\n" );
while( <README> )
{
   chomp $_;
   $ip = $1 if ( $_ =~ /((\d+)\.(\d+)\.(\d+)\.(\d+)).*/ );
}
close (README);

--- schnapp ---

Stefan

-- 
@home: <http://rifter.d-ip.de> @work: <http://www.liwing.de>
Ours is the age that is proud of machines that think and suspicious
of men who try to. (H. Mumford Jones, O Strange New World, 1965)
To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Tue 13 May 2003 - 22:40:21 CEST

search this site