[fli4l] Aktuelle WAN-IP auf Webserver

Wolfgang Loefstedt oliaros at web.de
Do Jan 29 20:11:49 CET 2015


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





Mehr Informationen über die Mailingliste Fli4L