Re: Dynamic DNS

From: ZooT aLLures (zoot@farts.com)
Date: Thu Jan 17 2002 - 09:26:21 CET


('binary' encoding is not supported, stored as-is) You should be able to use $ENV{REMOTE_ADDR} in a perl script running on thttpd to print out a dynamic DNS list to either an html page or possibly a flat file database.
A while back I was "diddling" with this in an attempt to create a filesharing system using little webservers.
Below is a script I did then, it's VERY rough, and has the "hooks" for a lot of other features/bugs/experiments 8^P....(ignore that man behind the curtain*L*)
Use it or toss it in the trash bin.......I'm only providing it as an example to look and possibly laugh at

###########################start of script######################
#!/usr/bin/perl

##########################################
#http2p version alpha 0.0.1
#put your path/to/perl above
#be sure this script is chmod 755 (executable)
#put your path/to/filesharers/list below

$ip_log="/usr/test/share/index.html";
$whoson="/usr/test/env.txt";

print "Content-Type: text/html\n\n";

print "<html><head><title> http2p test script</title></head>\n";
print "<body>test cgi for file sharing server<br>Your IP number is\n";
print "$ENV{REMOTE_ADDR}\n";
#print "$ENV{HTTP_REFERER}\n";
print "<br>You have been added to the file sharers list\n";
print "</body></html>\n";

#We use port 6122 below in order to avoid accidental connections

open (ADDUSER, ">>$ip_log");
print ADDUSER"<ahref=http://$ENV{REMOTE_ADDR}:6122/index.html>index_listing for $ENV{REMOTE_ADDR}</a><br>\n";
close (ADDUSER);

#Getting a list to check current user status

open (CHECKER, ">>$whoson");
print CHECKER "$ENV{REMOTE_ADDR}\n";
close (ADDUSER);

------------------------------------------------------------
Visit the world's greatest site at http://www.farts.com and listen to the fart
of the day. Also, get your very own farts.com E-mail account. FREE!!!!!

---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.dk
For additional commands, e-mail: mulinux-help@sunsite.dk



This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:21 CET