[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipcop-cvs
Subject:    [IPCop-cvs] CVS: ipcop/src/scripts setddns.pl,1.3.2.1,1.3.2.2
From:       Mark Wormgoor <riddles () users ! sourceforge ! net>
Date:       2003-04-29 11:42:13
[Download RAW message or body]

Update of /cvsroot/ipcop/ipcop/src/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv12864/src/scripts

Modified Files:
      Tag: IPCOP_v1
	setddns.pl 
Log Message:
Added support for selfhost.de

Index: setddns.pl
===================================================================
RCS file: /cvsroot/ipcop/ipcop/src/scripts/setddns.pl,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -C2 -d -r1.3.2.1 -r1.3.2.2
*** setddns.pl	30 Jun 2002 20:20:10 -0000	1.3.2.1
--- setddns.pl	29 Apr 2003 11:42:09 -0000	1.3.2.2
***************
*** 14,17 ****
--- 14,18 ----
  close(STDERR);
  
+ use IO::Socket;
  require 'CONFIG_ROOT/header.pl';
  
***************
*** 95,98 ****
--- 96,139 ----
  				{
  					&log("Dynamic DNS ip-update for $settings{'HOSTNAME'}.$settings{'DOMAIN'}: \
success"); + 					$success++;
+ 				}
+ 			}
+ 			elsif ($settings{'SERVICE'} eq 'selfhost')
+ 			{
+ 				my %proxysettings;
+ 				&readhash("CONFIG_ROOT/proxy/settings", \%proxysettings);
+ 
+ 				my $peer = 'www.ns4you.de';
+ 				my $peerport = 80;
+ 
+ 				if ($_=$proxysettings{'UPSTREAM_PROXY'}) {
+ 					($peer, $peerport) = (/^(?:[a-zA-Z \
]+\:\/\/)?(?:[A-Za-z0-9\_\.\-]*?(?:\:[A-Za-z0-9\_\.\-]*?)?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,5}))?(?:\/.*?)?$/);
 + 				}
+ 
+ 				my $sock;
+ 				unless($sock = new IO::Socket::INET (PeerAddr => $peer, PeerPort => $peerport, \
Proto => 'tcp', Timeout => 5)) { + 					die "Could not connect to $peer:$peerport: \
$@"; + 					return 1;
+ 				}
+ 
+ 			        my $GET_CMD;
+ 				$GET_CMD  = "GET \
http://www.ns4you.de/cgi-dns/dns.pl?$settings{'LOGIN'}&$settings{'PASSWORD'}&$ip \
HTTP/1.1\r\n"; + 				$GET_CMD .= "Host: www.ns4you.de\r\n";
+ 				$GET_CMD .= "Connection: close\r\n\r\n";
+ 				print $sock "$GET_CMD";
+ 
+ 				my $out = '';
+ 				while(<$sock>) {
+ 					$out .= $_;
+ 				}
+ 				close($sock);
+ 
+ 				if ( $out =~ m/<meta name="ns4you" title="error"/ ) {
+ 					&log("Dynamic DNS ip-update for failure");
+ 				}
+ 				else 
+ 				{
+ 					$out =~ m/<meta name="ns4you" title="url" content="(.*)"/;
+ 					&log("Dynamic DNS ip-update for $1: success");
  					$success++;
  				}



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
IPCop-cvs mailing list
IPCop-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic