[fli4l] Aktuelle WAN-IP auf Webserver

Helmut Sieckmann hsieckmann at t-online.de
Do Jan 29 22:32:50 CET 2015


Am 29.01.2015 um 20:11 schrieb Wolfgang Loefstedt:
> Hallo NG,
> ich möchte die aktuelle WAN-IP-Adresse meines fli4l v3.6.2 auf einen
> Webserver laden. Nach langem Suchen und Ausprobieren macht das folgende
> script genau das:
> 
> -------------------------cut here--------------------------
> #! /bin/sh
> EXTIP=$(wget http://checkip.dyndns.org/ -q -O - | grep -Eo
> '\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>')
> echo "machine myhomepage login user password pwd" > /.netrc
> chmod 600 /.netrc
> sed 's/_ip_/'$EXTIP'/g' /usr/local/bin/vorlage.txt > /tmp/datei.txt
> date >> /tmp/datei.txt
> (echo "passive"; echo "send /tmp/datei.txt dynip.html"; echo "bye" ) |
> ftp myhomepage
> rm /tmp/datei.txt
> -------------------------cut here--------------------------
> 
> 
> Wenn ich allerdings das script in /opt/etc/ppp/ip-up900.user kopiere,
> wird die IP auf der Webseite nicht aktualisert:
> 
> -------------------------cut here--------------------------
> #!/bin/sh
> #------------------------------------------------------------------------------
> # /etc/ppp/ip-up900.user
> #
> # Enter your specific commands here, wget etc.
> #
> # Creation:     08.09.2000  fm
> # Last Update:  $Id: ip-up900.user 5836 2004-06-23 14:27:08Z lanspezi $
> #------------------------------------------------------------------------------
> 
> # --- DO NOT MODIFY ---
> if [ "$is_default_route" = "yes" ] # is a default-route-interface going up?
> then
> # --- ADD YOUR COMMANDS HERE ---
>     echo
> 
> EXTIP=$(wget http://checkip.dyndns.org/ -q -O - | grep -Eo
> '\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>')
> echo "machine myhomepage login user password pwd" > /.netrc
> chmod 600 /.netrc
> sed 's/_ip_/'$EXTIP'/g' /usr/local/bin/vorlage.txt > /tmp/datei.txt
> date >> /tmp/datei.txt
> (echo "passive"; echo "send /tmp/datei.txt dynip.html"; echo "bye" ) |
> ftp myhomepage
> rm /tmp/datei.txt
> 
> # --- DO NOT MODIFY ---
> fi
> -------------------------cut here--------------------------
> 
> Was mache ich falsch?
> 
> Gruss, Wolfgang
> 
> 
> 
Also ich habe das bisher so gemacht:

#! /bin/sh
/bin/sed  -ne '$p' /boot/logip.log > /mnt/data/mail/ip.txt

Die IP Adresse aus der Datei lesen und den passenden Abschnitt in
eine neue Datei kopiert. Diese dann mit dem opt autoftp auf die Webseite
oder wohin auch immer geladen

P.S. das Script kenne ich nicht und sieht auch viel zu kompliziert aus :-))

Gruß Helmut


Mehr Informationen über die Mailingliste Fli4L