PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : freedns.afraid.org



small-talk
01.06.04, 00:35
Hi

Falls sich jemand mit diesem DynamicDNS auskennt wär cool, wenn ihr mir erklären könntet wo ich in der "update.pl" meine genauen daten machen muß.
Habe auf der Seite zwar eigentlich viel hilfe und sogar nen extra forum dafür, ABER ich bin dafür viel zu schlecht in englisch und verstehe nur bahnhof.

update.pl soll ein script sein um meine IP automatisch updaten

upade.pl:

#!/usr/bin/perl -w
# ^^^^^^^^^^^^^ set this to your path to perl


# Script name: ipupdate.pl
# Author: Werner Bleckwendt
# email: we_bl@yahoo.de
# Date: 6/6/2002
# Purpose: Updates the IP number when a new connection gets established
# has been tested with freedns.afraid.org and worked fine for me.
# As always .... there is no warranty of any kind, however you may use
# and modify this script to fit to your need.
################################################## ######################



my (%url, $notify, $always, $mailprogram, $local_file, $TimeStamp, $text, $domain, $rc, $url);



use LWP::Simple;



# Configure the URL's to reflect your update string(s)
# entries must be in the form "descriptive name","complete URL"
# You can use as many as you like.


%url=("domain 1", "http://freedns.afraid.org/dynamic/update.php?string1",
"domain 2","http://freedns.afraid.org/dynamic/update.php?string2");


# Put your email address in this variable to get an email, if an error accours


$notify='xxxxxxxxxxxxx@web.de';
# If you want to be notified everytime an update was executed, set this to "yes"
$always="yes";


# sendmail
$mailprogram="/usr/sbin/sendmail";


# put this file in /usr/local/bin and make it excecutable (chmod 755)
# add the following to the end of your ip-up script (on a SuSE machine it is
# usually /etc/ppp/ip-up):
# /usr/bin/perl /usr/local/bin/ipupdate.pl 2>&1 &


# done


################################################## #############################
#
# You should not need to modify anything below
#
################################################## #############################


# This variable is used for the download file
$local_file="/tmp/freedns.tmp";
$TimeStamp = localtime(time);
$text="";


# wait (seconds) to make sure a connection has been established
sleep 10;


# Don't use the buffer
$|=1;


while (($domain,$url) = each ( %url)) {

$rc = mirror("$url","$local_file");

print "ipupdate.pl executed. Domain: $domain Return code $rc\n";

if (is_success($rc)){
open (TX, $local_file) || die "Can't open Return File $!";
$text =<TX>;
close TX || die "Can't close Return File $!";
if ($text =~ /.*fail.*/ig){ $rc="490"};
}


if (is_error($rc) || $always =~ /yes/i){
&mail_error;
}


unlink $local_file;
}


sub mail_error {
open (MAIL, "|$mailprogram -t") || die "Can't open $mailprogram!\n$!\n";
print MAIL <<EOT;
To: $notify
From: ipupdate\@localhost
Subject: IP Update


While attempting to update the IP number for
$domain
with your DDNS, an error/success code was
returned: $rc


$TimeStamp


The URL was
$url



EOT


if ($text ne "") {
print MAIL <<EOT
The message returned by the host was:
$text


EOT


}


print MAIL "Your ip-update script\n";



close (MAIL) || die "Can't close $mailprogram!\n$!\n";


}
### end of script ###

City][Sepp
01.06.04, 07:02
Also ich kenn den Service zwar nicht (bin selber bei no-ip.com) aber würde mal Folgendes probieren:


%url=("Deine.Domain.blub", "http://freedns.afraid.org/dynamic/update.php?string1";)

(Domain2 rauslöschen)


$notify='deinemail@adresse.blub';


Naja und dann eben

# put this file in /usr/local/bin and make it excecutable (chmod 755)
# add the following to the end of your ip-up script (on a SuSE machine it is
# usually /etc/ppp/ip-up):
# /usr/bin/perl /usr/local/bin/ipupdate.pl 2>&1 &

was so viel heisst wie, dass Du das Script dann eben noch nach /usr/local/bin kopieren sollst, chmod 755 ausführen und in Dein ip-up Script, welches bei Suse unter /etc/ppp/ip-up liegt, ans Ende den Eintrag
/usr/bin/perl /usr/local/bin/ipupdate.pl 2>&1 &
einfügen sollst.....

Windoofsklicker
01.06.04, 21:06
mir ist folgende variante sympathischer:
lynx --source http://freedns.afraid.org/dynamic/update.php?deinupdatepfad

alles nach dem "?" kannst du herausfinden, wenn du im menü dynamicdns auf "direct url" klickst.

das kannst du dann prima im ip-up script einfügen.
das perl skript hat bei mir auch nicht wirklich funktioniert...

small-talk
01.06.04, 23:36
OK habe alles eingetragen.

Aber beim Ausführen bekomme ich nen Fehler:


Can't locate LWP/Simple.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at /usr/local/bin/ipupdate.pl line 21.
BEGIN failed--compilation aborted at /usr/local/bin/ipupdate.pl line 21.


OK ich weiß schon das Modul LWP/Simple.pm fehlt. Bräuchte da dann aber nen downloadlink ich habe gerade 60min ohne erfolg gesucht. finde immer nur LWP/Simple-Cookies-0.01.tar.gz oder ist das das Modul was fehlt?

core
01.06.04, 23:45
Perl Module installiert man am besten mit cpan..
search.cpan.org
Das wäre dann perl -MCPAN -e 'install LWP::Simple'

Allerdings sind die LWP:: Module fast überall dabei. Paket heisst meist libwww-perl oder perl-www<whatever>

Gruss