Re: IP-Ermittlung_per_shell-skript

From: Dominik Brettnacher <domi(at)saargate.de>
Date: Fri, 27 Oct 2000 06:29:59 +0200 (CEST)

On Fri, 27 Oct 2000, Gordon.E(at)web.de wrote:

> Ich habe folgenden Ausschnitt aus einem shell-skript, mit dem man die
> momentane IP-Adresse (ISP) ermittelt (FreeBSD 4.1):
>
> #!/bin/sh
> GETMYIP=$(/sbin/ifconfig tun0 | awk '/inet/{print $2}')
> echo "Aktuelle IP: $GETMYIP"
> unset GETMYIP
> exit
>
> Ist ja alles schön und gut... aber leider spuckt das skript nicht nur die
> IP, sondern noch irgendeine wirre Zahl vorher aus.

Ich schätze mal, daß das die IPv6-Adresse ist. Ersetze im awk-Aufruf das
/inet/ durch /inet / (mit Leerstelle). Oder schalte IPv6 ab (also raus
damit aus dem Kernel).

-- 
Dominik - http://www.brettnacher.org/users/dominik/
"I think we'd order our lives via 1-800 numbers if we could." - Coupland
To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Fri 27 Oct 2000 - 06:39:21 CEST

search this site