dyndns/0040755000076500007650000000000007571253166012313 5ustar jumpjoejumpjoedyndns/images/0040755000076500007650000000000007564303510013547 5ustar jumpjoejumpjoedyndns/images/icon.gif0100644000076500007650000000046707566445546015214 0ustar jumpjoejumpjoeGIF89a00fff!,00ڋ !q|]FX-0wcC"G`x}a8@'4c9T"d\۸.~3'73%PV35X#&# I )H& +;+u#$d۴F{#로t\A#2]!8Z`(-xkìuɢVgY0VcҮJQ[6)gjL !'YF4e< J:zB;dyndns/index.cgi0100755000076500007650000000333407571244024014102 0ustar jumpjoejumpjoe#!/usr/bin/perl ##################################################################################################################################### # # DynDNS module for webmin # Written by Giovanni Beltrame, 2002 # This module is GPL licensed # ##################################################################################################################################### require './dyndns-lib.pl'; my @links, @names, @icons; # Parse arguments &ReadParse(); # Check save and apply options &generate_script() if $in{"generate"}; &header( "Dynamic DNS Provider" , "" , config => 1); # Initalize display table $number = $dyndns_config{'DYNDNS_N'} unless $number = $in{'number'}; $nextnum = $number+1; print "
Add an entry\n
"; for( $j = 0 ; $j < $number ; $j++ ) { $i = $j+1; $links[$j]="entry.cgi?number=$i"; $names[$j]=$dyndns_config{"DYNDNS_HOST_$i"}.".".$dyndns_config{"DYNDNS_DOMAIN_$i"}; $icons[$j]="images/icon.gif"; } print icons_table( \@links , \@names , \@icons ); print "
\n"; # If generate is true, then the config will be saved and the script generated print ""; print ""; # Hold the number of stored configurations print "
"; print " \n"; print " \n"; print "

 \n"; &jwindow( "./update.cgi", "response" , "200" , "300" ) if $in{update}; &footer( "" , "module index" ); dyndns/module.info0100644000076500007650000000010707566441576014460 0ustar jumpjoejumpjoename=dyndns desc=Dynamic DNS provider os_support=*-linux category=net dyndns/dyndns-lib.pl0100644000076500007650000002002007571243730014676 0ustar jumpjoejumpjoe#!/usr/bin/perl ##################################################################################################################################### # # Some init for DynDNS Webmin Module # Written by Giovanni Beltrame # GPL licensed # ##################################################################################################################################### # Some init stuff do '../web-lib.pl'; require '../javascript-lib.pl'; &init_config(); # Some variables my $configfile = "./config.txt"; my $additional = "./dyndns.conf"; my $scriptfile = "./ip-up.dyndns"; %dyndns_config; %provider_config; # Internal Methods # Create startup script sub generate_script { my $self = shift; my $i = 1; my $outfile , $script; my $j = $dyndns_config{'DYNDNS_N'}; # Open files for writing open( SCRIPT , "> $config{scriptfile}" ); open( DYNFLI , "> /tmp/dynpass" ); # Cycle through providers while ( $i <= $j ) { # get config entries for provider $i my $provider = $dyndns_config{"DYNDNS_PROVIDER_$i"}; my $username = $dyndns_config{"DYNDNS_USER_$i"}; my $password = $dyndns_config{"DYNDNS_PASSWORD_$i"}; my $hostname = $dyndns_config{"DYNDNS_HOST_$i"}; my $domainname = $dyndns_config{"DYNDNS_DOMAIN_$i"}; my $secret = $dyndns_config{"DYNDNS_SECRET_$i"}; my $MYIP = `cat $config{ipfile}`; chomp $MYIP; # get provider specific data my $providername = $provider_config{"PROVIDER_".$provider."_NAME"}; my $url = $provider_config{"PROVIDER_".$provider."_REQUEST_URL"}; my $host = $provider_config{"PROVIDER_".$provider."_REQUEST_HOST"}; my $port = $provider_config{"PROVIDER_".$provider."_REQUEST_PORT"}; my $auth = $provider_config{"PROVIDER_".$provider."_REQUEST_AUTHBASIC"}; # expand the variables in $url $url =~ s/(\$\w+)/$1/gee; if( $config{save_output} == 1 ) { $outfile = "./answer.$providername"; } else { $outfile = ""; } # write everything to the script if( $outfile ) { print SCRIPT "if [ -f $outfile ] ; then\n"; print SCRIPT " echo > $outfile\n"; print SCRIPT "fi\n"; print SCRIPT "echo \"-----------------------------------------\" >> $outfile\n"; print SCRIPT "date >> $outfile\n"; print SCRIPT "echo \"-----------------------------------------\" >> $outfile\n"; } else { print SCRIPT "echo \"----- start answer -----\"\n"; } if( $provider eq 'DYNFLI4L' ) { print SCRIPT "{ echo \"GET /gnudip/cgi-bin/gdipupdt.cgi HTTP/1.1\"\n"; print SCRIPT " echo \"Host: $host\"\n"; print SCRIPT " echo \"User-Agent: opt_dyndns/2.1.14 me\@null.net\"\n"; print SCRIPT " echo \"\"\n"; print SCRIPT "} | /usr/bin/nc -w 20 $host $port > /tmp/dynfli4l.return \n"; print SCRIPT " salt=\`cat /tmp/dynfli4l.return | grep \"salt\" | sed 's///g'\` \n"; print SCRIPT " sign=\`cat /tmp/dynfli4l.return | grep \"sign\" | sed 's///g'\` \n"; print SCRIPT " time=\`cat /tmp/dynfli4l.return | grep \"time\" | sed 's///g'\` \n"; print ( DYNFLI "$DYNDNS_PASSWORD" ); print SCRIPT " md5pass=\`/usr/local/bin/md5sum /tmp/dynpass | sed 's\ /tmp/dynpass\\\\\'\` \n"; print SCRIPT " saltpass=\`echo -n \"\$md5pass\".\"\$salt\" > /tmp/dynpass2\` \n"; print SCRIPT " endpass=\`/usr/local/bin/md5sum /tmp/dynpass2 | sed 's\ /tmp/dynpass2\\\\\'\` \n"; print SCRIPT "{ echo \"GET $url HTTP/1.1\"\n"; print SCRIPT " echo \"Host: $host\"\n"; print SCRIPT " echo \"User-Agent: dyndns/1.0 me\@null.net\"\n"; print SCRIPT " echo \"\"\n"; print SCRIPT "} | /usr/bin/nc -w 20 $host $port > $outfile \n"; } else { print SCRIPT "{ echo \"GET $url HTTP/1.1\"\n"; print SCRIPT " echo \"Host: $host\"\n"; if ( $auth eq 'yes' ) { print SCRIPT " echo \"Authorization: Basic $secret\"\n"; } print SCRIPT " echo \"User-Agent: dyndns/1.0 me\@null.net\"\n"; print SCRIPT " echo \"\"\n"; printf( SCRIPT "} | /usr/bin/nc -w 20 $host $port"); } if( $outfile ) { print SCRIPT " >> $outfile\n"; } else { print SCRIPT "\n"; print SCRIPT "echo \"\"\n"; print SCRIPT "echo \"------ end answer ------\"\n"; } $i++; } close( SCRIPT ); close( DYNFLI ); } sub add_entry { my $i = shift; open( SCRIPT , ">> config.txt" ); print SCRIPT "\n\nDYNDNS_PROVIDER_$i='1' # provider\n"; print SCRIPT "DYNDNS_USER_$i='' # username\n"; print SCRIPT "DYNDNS_PASSWORD_$i='' # password\n"; print SCRIPT "DYNDNS_HOST_$i='' # host part of myhost.dyn-fli4l.de\n"; print SCRIPT "DYNDNS_DOMAIN_$i='' # domain part of myhost.dyn-fli4l.de\n"; print SCRIPT "DYNDNS_SECRET_$i='' # (for dynfli4l.de&co same as password, uncrypted)\n"; close( SCRIPT ); } sub save { &write_env_file( $configfile , \%dyndns_config ,0 ); } sub remove { my $j = shift; my $i , $done = 6; delete($dyndns_config{"DYNDNS_PROVIDER_$j"}); delete($dyndns_config{"DYNDNS_USER_$j"}); delete($dyndns_config{"DYNDNS_PASSWORD_$j"}); delete($dyndns_config{"DYNDNS_DOMAIN_$j"}); delete($dyndns_config{"DYNDNS_HOST_$j"}); delete($dyndns_config{"DYNDNS_SECRET_$j"}); if( $j < $dyndns_config{'DYNDNS_N'} ) { my $cont; for( $cont = $j+1 ; $cont <= $dyndns_config{'DYNDNS_N'} ; $cont++ , $j++) { $dyndns_config{"DYNDNS_PROVIDER_$j"} = $dyndns_config{"DYNDNS_PROVIDER_$cont"}; $dyndns_config{"DYNDNS_USER_$j"} = $dyndns_config{"DYNDNS_USER_$cont"}; $dyndns_config{"DYNDNS_PASSWORD_$j"} = $dyndns_config{"DYNDNS_PASSWORD_$cont"}; $dyndns_config{"DYNDNS_DOMAIN_$j"} = $dyndns_config{"DYNDNS_DOMAIN_$cont"}; $dyndns_config{"DYNDNS_HOST_$j"} = $dyndns_config{"DYNDNS_HOST_$cont"}; $dyndns_config{"DYNDNS_SECRET_$j"} = $dyndns_config{"DYNDNS_SECRET_$cont"}; delete($dyndns_config{"DYNDNS_PROVIDER_$cont"}); delete($dyndns_config{"DYNDNS_USER_$cont"}); delete($dyndns_config{"DYNDNS_PASSWORD_$cont"}); delete($dyndns_config{"DYNDNS_DOMAIN_$cont"}); delete($dyndns_config{"DYNDNS_HOST_$cont"}); delete($dyndns_config{"DYNDNS_SECRET_$cont"}); } } $dyndns_config{"DYNDNS_N"}--; &save(); } sub save2 { my ( %x ) = @_; my $j; open( SCRIPT , "> $configfile" ); print SCRIPT < $dyndns_config{"DYNDNS_N"} ; # Save or remove entry if necessary if( $in{'save'} ) { &save(); &redirect( "index.cgi" ); } if( $in{'remove'} ) { &remove($j); &redirect( "index.cgi" ); } &header( "Dynamic DNS Provider" , ""); print "\n
\n\n"; # Start form, where domains is used to store the selected provider in order to display correct domains print <
Data for account #$j
Provider:
Username:
Password:
Hostname:
Domain:

"; print "

\n\n"; print " 
 \n"; &footer( "" , "module index" ); dyndns/update.cgi0100755000076500007650000000105307571245622014256 0ustar jumpjoejumpjoe#!/usr/bin/perl ##################################################################################################################################### # # DynDNS module for webmin # Written by Giovanni Beltrame, 2002 # This module is GPL licensed # ##################################################################################################################################### print "Content-type: text/plain \n\n"; require '../web-lib.pl'; &init_config(); open( PIPE , "sh $config{scriptfile} |" ); foreach () { print; } close( PIPE );