dyndns/ 0040755 0000765 0000765 00000000000 07571253166 012313 5 ustar jumpjoe jumpjoe dyndns/images/ 0040755 0000765 0000765 00000000000 07564303510 013547 5 ustar jumpjoe jumpjoe dyndns/images/icon.gif 0100644 0000765 0000765 00000000467 07566445546 015214 0 ustar jumpjoe jumpjoe GIF89a0 0 fff! , 0 0 ڋ
!q|]FX-0wcC"G`x}a8@'4c 9T"d\۸.~3'73%PV35X# I )H&
+;+u#$d۴F{#로t\A#2]!8Z`(-xkìuɢVgY0VcҮJQ[6)gjL!'YF4e< J:zB ; dyndns/index.cgi 0100755 0000765 0000765 00000003334 07571244024 014102 0 ustar jumpjoe jumpjoe #!/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";
&jwindow( "./update.cgi", "response" , "200" , "300" ) if $in{update};
&footer( "" , "module index" );
dyndns/module.info 0100644 0000765 0000765 00000000107 07566441576 014460 0 ustar jumpjoe jumpjoe name=dyndns
desc=Dynamic DNS provider
os_support=*-linux
category=net
dyndns/dyndns-lib.pl 0100644 0000765 0000765 00000020020 07571243730 014676 0 ustar jumpjoe jumpjoe #!/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 <