Updated for Scrut fix

This commit is contained in:
laf
2016-01-18 12:54:25 +00:00
parent cc25e87bcd
commit 47ff913baa

View File

@@ -1330,7 +1330,7 @@ function oxidized_reload_nodes() {
* @return string ip
*
**/
function dnslookup($device,$type=false) {
function dnslookup($device,$type=false,$return=false) {
if (filter_var($device['hostname'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) == true || filter_var($device['hostname'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) == truee) {
return '';
}
@@ -1345,6 +1345,9 @@ function dnslookup($device,$type=false) {
$return = 'ip';
}
}
if (empty($return)) {
return '';
}
$record = dns_get_record($device['hostname'],$type);
return $record[0][$return];
}//end dnslookup