lügnix
Spezialist
- Registriert
- 4. April 2010
- Beiträge
- 574
- Lösungen
- 1
- Reaktionspunkte
- 78
- Punkte
- 98
AW: IPC mit zwei Netzwerkkarten
'inet addr:' hat bei mir nicht funktioniert. Musste es auf 'inet Adresse:' ändern
Hallo,
ich habe mir mal das DDNSupdater2.sh angeschaut, dort wird die Globale-IP per "wget-Befehl" bei verschiedenen IP-Responsediensten geholt.
"wget" hat viele optionen, wie manSie müssen registriert sein, um Links zu sehen.sehen kann.
Man könnte vielleicht:
in die Befehle mit einbauen.Code:‘--bind-address=ADDRESS’
Gruß
jensebub
/EDIT: dann könnte man in Z.57 vor "CONFIG - END" die Einzustellende Netzwerkkarte eintragen:
Code:#Netzwerkkarte ETH='eth0'
Und dann die folgenden Zeilen:
durch folgende ersetzen:Code:# get current internet ip CURRENTIP=$(wget -q -O - http://myip.dnsomatic.com) if [ -z "$CURRENTIP" -o "$CURRENTIP" = " *" -o "$CURRENTIP" = "*1.0 *" ]; then CURRENTIP=$(wget -q -O - http://my.ip.fi) fi if [ -z "$CURRENTIP" -o "$CURRENTIP" = " *" -o "$CURRENTIP" = "*1.0 *" ]; then CURRENTIP=$(wget -q -O - http://www.myip.ch | grep "IP Address" | cut -d ' ' -f4 | sed -e 's/\$//g' -e 's/\\r//g') fi if [ -z "$CURRENTIP" -o "$CURRENTIP" = " *" -o "$CURRENTIP" = "*1.0 *" ]; then CURRENTIP=$(wget -q -O - http://www.ip-lookup.de | grep -Eo '\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>') fi if [ -z "$CURRENTIP" -o "$CURRENTIP" = " *" -o "$CURRENTIP" = "*1.0 *" ]; then CURRENTIP=$(wget -q -O - http://checkip.dyndns.org | sed s/[^0-9.]//g) fi if [ -z "$CURRENTIP" -o "$CURRENTIP" = " *" -o "$CURRENTIP" = "*1.0 *" ]; then CURRENTIP=$(wget -q -O - http://checkip.two-dns.de | grep "IP Address" | cut -d ' ' -f4 | sed -e 's/\$//g' -e 's/\\r//g') fi
Code:# get current internet ip CURRENTIP=$(wget -q --bind-address=`ifconfig "$ETH" | grep '[B][COLOR=#ff0000]inet addr[/COLOR][/B]:' | cut -d: -f2 | awk '{print $1}'` -O - http://myip.dnsomatic.com) if [ -z "$CURRENTIP" -o "$CURRENTIP" = " *" -o "$CURRENTIP" = "*1.0 *" ]; then CURRENTIP=$(wget -q --bind-address=`ifconfig "$ETH" | grep '[B][COLOR=#ff0000]inet addr[/COLOR][/B]:' | cut -d: -f2 | awk '{print $1}'` -O - http://my.ip.fi) fi if [ -z "$CURRENTIP" -o "$CURRENTIP" = " *" -o "$CURRENTIP" = "*1.0 *" ]; then CURRENTIP=$(wget -q --bind-address=`ifconfig "$ETH" | grep '[B][COLOR=#ff0000]inet addr[/COLOR][/B]:' | cut -d: -f2 | awk '{print $1}'` -O - http://www.myip.ch | grep "IP Address" | cut -d ' ' -f4 | sed -e 's/\$//g' -e 's/\\r//g') fi if [ -z "$CURRENTIP" -o "$CURRENTIP" = " *" -o "$CURRENTIP" = "*1.0 *" ]; then CURRENTIP=$(wget -q --bind-address=`ifconfig "$ETH" | grep '[B][COLOR=#ff0000]inet addr[/COLOR][/B]:' | cut -d: -f2 | awk '{print $1}'` -O - http://www.ip-lookup.de | grep -Eo '\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>') fi if [ -z "$CURRENTIP" -o "$CURRENTIP" = " *" -o "$CURRENTIP" = "*1.0 *" ]; then CURRENTIP=$(wget -q --bind-address=`ifconfig "$ETH" | grep '[B][COLOR=#ff0000]inet addr[/COLOR][/B]:' | cut -d: -f2 | awk '{print $1}'` -O - http://checkip.dyndns.org | sed s/[^0-9.]//g) fi if [ -z "$CURRENTIP" -o "$CURRENTIP" = " *" -o "$CURRENTIP" = "*1.0 *" ]; then CURRENTIP=$(wget -q --bind-address=`ifconfig "$ETH" | grep '[B][COLOR=#ff0000]inet addr[/COLOR][/B]:' | cut -d: -f2 | awk '{print $1}'` -O - http://checkip.two-dns.de | grep "IP Address" | cut -d ' ' -f4 | sed -e 's/\$//g' -e 's/\\r//g') fi
so sollte es funktionieren
'inet addr:' hat bei mir nicht funktioniert. Musste es auf 'inet Adresse:' ändern
Zuletzt bearbeitet von einem Moderator: