#!/usr/bin/perl ## Dynamic DNS for updater for dynamic.name-server.com addresses ## meant to run with cron. works on a mac (why i wrote it) # get IP address and strip formatting $ip = `/sw/bin/lynx -dump \"http://checkip.dyndns.org\"`; $ip =~ s/Current IP Address://g; $ip =~ s/\n//g; $ip =~ s/ //g; #store current IP open (F, "IP"); while () { $oldip = $_; } $oldip =~ s/\n//g; close F; # if IP has changed edit stored IP if ($ip ne $oldip) { open (F, ">IP"); print F "$ip"; close F; $log = `/sw/bin/lynx -dump \"http://dynamic.name-services.com/interface.asp?command=setdnshost&zone=DOMAIN_NAME&domainpassword=PASSWORD&address=$ip\"`; }