Wrong carriage return on the php for some reason
This commit is contained in:
parent
feeb5a5c02
commit
b6b4ac1009
@ -1,43 +1,43 @@
|
|||||||
#!/usr/local/bin/php-cgi -f
|
#!/usr/local/bin/php-cgi -f
|
||||||
<?php
|
<?php
|
||||||
require_once("config.inc");
|
require_once("config.inc");
|
||||||
require_once("gwlb.inc");
|
require_once("gwlb.inc");
|
||||||
require_once("interfaces.inc");
|
require_once("interfaces.inc");
|
||||||
|
|
||||||
$host = gethostname();
|
$host = gethostname();
|
||||||
$source = "pfconfig";
|
$source = "pfconfig";
|
||||||
|
|
||||||
$iflist = get_configured_interface_with_descr(true);
|
$iflist = get_configured_interface_with_descr(true);
|
||||||
foreach ($iflist as $ifname => $friendly) {
|
foreach ($iflist as $ifname => $friendly) {
|
||||||
$ifinfo = get_interface_info($ifname);
|
$ifinfo = get_interface_info($ifname);
|
||||||
$ifstatus = $ifinfo['status'];
|
$ifstatus = $ifinfo['status'];
|
||||||
$ifconf = $config['interfaces'][$ifname];
|
$ifconf = $config['interfaces'][$ifname];
|
||||||
$ipaddr = get_interface_ip($ifname);
|
$ipaddr = get_interface_ip($ifname);
|
||||||
$subnet = get_interface_subnet($ifname);
|
$subnet = get_interface_subnet($ifname);
|
||||||
$ipaddr6 = get_interface_ipv6($ifname);
|
$ipaddr6 = get_interface_ipv6($ifname);
|
||||||
$subnet6 = get_interface_subnetv6($ifname);
|
$subnet6 = get_interface_subnetv6($ifname);
|
||||||
$realif = get_real_interface($ifname);
|
$realif = get_real_interface($ifname);
|
||||||
$mac = get_interface_mac($realif);
|
$mac = get_interface_mac($realif);
|
||||||
|
|
||||||
if (strtolower($ifstatus) == "up"){
|
if (strtolower($ifstatus) == "up"){
|
||||||
$ifstatus = 1;
|
$ifstatus = 1;
|
||||||
}
|
}
|
||||||
if (strtolower($ifstatus) == "no carrier"){
|
if (strtolower($ifstatus) == "no carrier"){
|
||||||
$ifstatus = 0;
|
$ifstatus = 0;
|
||||||
}
|
}
|
||||||
if (!isset($ifstatus)){
|
if (!isset($ifstatus)){
|
||||||
$ifstatus = "Unknown";
|
$ifstatus = "Unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($ipaddr)) {
|
if (!empty($ipaddr)) {
|
||||||
printf("interfaces,host=%s,name=%s,ip_address=%s,friendlyname=%s,source=%s status=%s\n",
|
printf("interfaces,host=%s,name=%s,ip_address=%s,friendlyname=%s,source=%s status=%s\n",
|
||||||
$host,
|
$host,
|
||||||
$realif,
|
$realif,
|
||||||
$ipaddr,
|
$ipaddr,
|
||||||
$friendly,
|
$friendly,
|
||||||
$source,
|
$source,
|
||||||
$ifstatus
|
$ifstatus
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user