From: Franck B. <fra...@us...> - 2007-07-31 11:17:40
|
Update of /cvsroot/ipcop/ipcop/src/scripts In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv20257/src/scripts Modified Files: Tag: IPCOP_v1_4_0 setddns.pl Log Message: Add dyndns provider 'editdns.net' (sf#1698882) Fix typo and some comments. Index: setddns.pl =================================================================== RCS file: /cvsroot/ipcop/ipcop/src/scripts/setddns.pl,v retrieving revision 1.4.2.47 retrieving revision 1.4.2.48 diff -C2 -d -r1.4.2.47 -r1.4.2.48 *** setddns.pl 18 May 2007 13:25:27 -0000 1.4.2.47 --- setddns.pl 31 Jul 2007 11:17:35 -0000 1.4.2.48 *************** *** 142,146 **** Net::SSLeay::make_headers('User-Agent' => 'Ipcop' ) ); ! if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/has been updated to point to/ ) { --- 142,147 ---- Net::SSLeay::make_headers('User-Agent' => 'Ipcop' ) ); ! #Valid responses from service are: ! # has been updated to point to if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/has been updated to point to/ ) { *************** *** 171,175 **** Net::SSLeay::make_headers('User-Agent' => 'Ipcop' ) ); ! if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/success/ ) { --- 172,177 ---- Net::SSLeay::make_headers('User-Agent' => 'Ipcop' ) ); ! #Valid responses from service are: ! # success if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/success/ ) { *************** *** 206,210 **** ) ); ! # Valid response are 'ok' 'nochange' if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/^(ok|nochange)/ ) { --- 208,213 ---- ) ); ! # Valid response are ! # 'ok' 'nochange' if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/^(ok|nochange)/ ) { *************** *** 241,245 **** #Valid responses from service are: # now points to - # if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/Host .* now points to/ig ) { --- 244,247 ---- *************** *** 276,280 **** #Valid responses from service are: # 02 == Domain already exists, refreshing data for ... => xxx.xxx.xxx.xxx - # if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/Domain already exists, refreshing data for/ig ) { --- 278,281 ---- *************** *** 288,292 **** } } ! # easydns => ez-ipupdate elsif ($settings{'SERVICE'} eq 'enom') { # use proxy ? --- 289,326 ---- } } ! # easydns => see 'ez-ipupdate' ! elsif ($settings{'SERVICE'} eq 'editdns') { ! # use proxy ? ! my %proxysettings; ! &General::readhash("${General::swroot}/proxy/settings", \%proxysettings); ! if ($_=$proxysettings{'UPSTREAM_PROXY'}) { ! my ($peer, $peerport) = (/^(?:[a-zA-Z ]+\:\/\/)?(?:[A-Za-z0-9\_\.\-]*?(?:\:[A-Za-z0-9\_\.\-]*?)?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,5}))?(?:\/.*?)?$/); ! Net::SSLeay::set_proxy($peer,$peerport,$proxysettings{'UPSTREAM_USER'},$proxysettings{'UPSTREAM_PASSWORD'} ); ! } ! if ($settings{'HOSTNAME'} eq '') { ! $settings{'HOSTDOMAIN'} = $settings{'DOMAIN'}; ! } else { ! $settings{'HOSTDOMAIN'} = "$settings{'HOSTNAME'}.$settings{'DOMAIN'}"; ! } ! ! my ($out, $response) = Net::SSLeay::get_http( 'dyndns.editdns.net', ! 80, ! "/api/dynLinux.php?r=$settings{'HOSTDOMAIN'}&p=$settings{'PASSWORD'}", ! Net::SSLeay::make_headers('User-Agent' => 'Ipcop' ) ! ); ! #Valid responses from service are: ! # Record has been updated ! # Record already exists with the same IP ! if ($response =~ m%HTTP/1\.. 200 OK%) { ! if ( $out !~ m/Record (has been updated|already exists with the same IP)/ ) { ! &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : failure ($out)"); ! } else { ! &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : success"); ! $success++; ! } ! } else { ! &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : failure (could not connect to server)"); ! } ! } elsif ($settings{'SERVICE'} eq 'enom') { # use proxy ? *************** *** 308,318 **** Net::SSLeay::make_headers('User-Agent' => 'Ipcop' ) ); ! if ($response =~ m%HTTP/1\.. 200 OK%) { - #Valid responses from update => ErrCount=0 if ( $out !~ m/ErrCount=0/ ) { $out =~ s/(\n|\x0D)/ /g; $out =~ /Err1=([\w ]+) /; ! &General::log("Dynamic DNS ip-update for $settings{'HOSTMAIN'} : failure ($1)"); } else { &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : success"); --- 342,352 ---- Net::SSLeay::make_headers('User-Agent' => 'Ipcop' ) ); ! #Valid responses from service are: ! # ErrCount=0 if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/ErrCount=0/ ) { $out =~ s/(\n|\x0D)/ /g; $out =~ /Err1=([\w ]+) /; ! &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : failure ($1)"); } else { &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : success"); *************** *** 347,351 **** ); #Valid responses from service are: - # # "... Exit code: 0" 0:ok else error if ($response =~ m%HTTP/1\.. 200 OK%) { --- 381,384 ---- *************** *** 375,382 **** ); #Valid responses from service are: ! #Updated n host(s) <domain> ! #ERROR: <ip> has not changed. if ($response =~ m%HTTP/1\.. 200 OK%) { - #Valid responses from update => ErrCount=0 if ( $out !~ m/(^Updated|Address .* has not changed)/ig ) { &General::log("Dynamic DNS ip-update for $settings{'HOSTNAME'}.$settings{'DOMAIN'} : failure ($out)"); --- 408,414 ---- ); #Valid responses from service are: ! # Updated n host(s) <domain> ! # ERROR: <ip> has not changed. if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/(^Updated|Address .* has not changed)/ig ) { &General::log("Dynamic DNS ip-update for $settings{'HOSTNAME'}.$settings{'DOMAIN'} : failure ($out)"); *************** *** 403,407 **** Net::SSLeay::make_headers('User-Agent' => 'Ipcop' ) ); ! #Valid responses from service is: # wait confirmation!! if ($response =~ m%HTTP/1\.. 200 OK%) { --- 435,439 ---- Net::SSLeay::make_headers('User-Agent' => 'Ipcop' ) ); ! #Valid responses from service are: # wait confirmation!! if ($response =~ m%HTTP/1\.. 200 OK%) { *************** *** 534,540 **** ) ); ! #HTTP response ! #Valid responses from service:'good ip-address' , 'nochg ip-address' (ez-ipupdate like) ! if ($response =~ m%HTTP/1\.. 200 OK%) { if ($out =~ m/good |nochg /ig) { --- 566,571 ---- ) ); ! #Valid responses from service are: ! # 'good ip-address' , 'nochg ip-address' (ez-ipupdate like) if ($response =~ m%HTTP/1\.. 200 OK%) { if ($out =~ m/good |nochg /ig) { *************** *** 572,579 **** 'Authorization' => "Basic $code64" ) ); ! ! #HTTP response ! #Valid responses from service:'good ip-address' , 'nochg ip-address' (ez-ipupdate like) ! if ($response =~ m%HTTP/1\.. 200 OK%) { if ($out =~ m/good |nochg /ig) { --- 603,608 ---- 'Authorization' => "Basic $code64" ) ); ! #Valid responses from service are: ! # 'good ip-address' , 'nochg ip-address' (ez-ipupdate like) if ($response =~ m%HTTP/1\.. 200 OK%) { if ($out =~ m/good |nochg /ig) { *************** *** 604,609 **** ); #Valid responses from service are: ! #success|100|update succeeded! ! #success|101|no update needed at this time.. if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/(success\|(100|101)\|)/ig ) { --- 633,638 ---- ); #Valid responses from service are: ! # success|100|update succeeded! ! # success|101|no update needed at this time.. if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/(success\|(100|101)\|)/ig ) { *************** *** 633,637 **** #Valid responses from service are: # <strong><b>Your Dynamic DNS change was accepted by our system</b></strong> - # if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/DNS change was accepted/ig ) { --- 662,665 ---- *************** *** 660,664 **** Net::SSLeay::make_headers('User-Agent' => 'Ipcop' ) ); ! if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/(success)/ ) { --- 688,693 ---- Net::SSLeay::make_headers('User-Agent' => 'Ipcop' ) ); ! #Valid responses from service are: ! # success if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/(success)/ ) { *************** *** 692,696 **** Net::SSLeay::make_headers('User-Agent' => 'Ipcop' ) ); ! if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/status=(200|204)/ ) { --- 721,726 ---- Net::SSLeay::make_headers('User-Agent' => 'Ipcop' ) ); ! #Valid responses from service are: ! # status=200 status=204 if ($response =~ m%HTTP/1\.. 200 OK%) { if ( $out !~ m/status=(200|204)/ ) { *************** *** 705,709 **** } } ! # zonedit => ez-ipupdate else { if ($settings{'WILDCARDS'} eq 'on') { --- 735,739 ---- } } ! # zonedit => see 'ez-ipupdate' else { if ($settings{'WILDCARDS'} eq 'on') { |