<?php/* Dynamic IP Round Robin Script * ============================= * Programed by Michael Allan Wheeler * irc.fuseirc.net #main * --------------------- * Description : * Used to update round robin ips. *//* Debugging - true / false */$debug = false;/* Path to wget - For some reason I need this */$wget_path = '/usr/local/bin/';/* URL For DNS Records */$urls = array("http://freedns.afraid.org/dynamic/update.php?1","http://freedns.afraid.org/dynamic/update.php?2","http://freedns.afraid.org/dynamic/update.php?3","http://freedns.afraid.org/dynamic/update.php?4","http://freedns.afraid.org/dynamic/update.php?5");/* The hosts to resolve - There should be same number of hosts as urls.*/$hosts = array("host1.com","host2.net" ,"irc.fuseirc.net","theskorm.net","blah.net");/* The address to use as a filoler when a port times out */$filler = "theskorm.net";/* Port to check to see if box is alive and ticking */$port = "6667";/* You DONOT need to edit anything under this, unless you know what your doing or some who does tells you so */error_reporting(0);foreach($hosts as $keys => $value) { if($debug==true){print "$keys - Getting $value IP... \n";} $checkport = fsockopen($value, $port, $errnum, $errstr, 20); if(!$checkport){ $ip = gethostbyname($filler); if($debug==true){print "$keys - Port closed or ping timeout, using ".$filler." as filler\n";} }else{ $ip = gethostbyname($value); }; if($debug==true){print "$keys - Got Ip - $ip \n";} $finalcommand = $wget_path . "wget -q --delete-after " . $urls[$keys] . "\\&address=" . $ip ; if($debug==true){print "$keys - Running wget \n";} exec($finalcommand);}?>