function dump() { $ipaddr = gethostbyname("nosslsearch.google.com"); $ip = new IP(); $OK = true; if (!$ip->isIPv4($ipaddr)) { $OK = false; } if (!$OK) { if ($ip->isIPv6($ipaddr)) { $OK = true; } } if (!$OK) { echo "Failed nosslsearch.google.com `{$ipaddr}` not an IP address...!!!\n"; return; } $array = GetWebsitesList(); if (count($array) == 0) { echo "Failed!!! -> GetWebsitesList();\n"; return; } while (list($table, $fff) = each($array)) { echo "{$fff}\t{$ipaddr}\n"; } }
function remove() { $unix = new unix(); $entry = $unix->get_EtcHostsByName("www.google.com"); if ($entry == null) { return; } $array = GetWebsitesList(); while (list($table, $fff) = each($array)) { $unix->del_EtcHostsByName($fff); $c++; } if ($c > 0) { echo "Starting......: " . date("H:i:s") . " Squid : removing {$c} google servers from /etc/hosts\n"; reload_pdns(); } }