summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/usr/local/bin/dhcpd_gather_stats.php10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/usr/local/bin/dhcpd_gather_stats.php b/src/usr/local/bin/dhcpd_gather_stats.php
index f76f9d9..128fe0f 100644
--- a/src/usr/local/bin/dhcpd_gather_stats.php
+++ b/src/usr/local/bin/dhcpd_gather_stats.php
@@ -31,15 +31,12 @@ echo "N:";
$result = "NaN";
$result_static="NaN";
-if (isset($argv[1])) {
+if (is_array($config['dhcpd'][$argv[1]])) {
$leasesfile = "{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases";
$leases_contents = file($leasesfile);
$dhcpif = $argv[1] ;
-
-
-
function remove_duplicate($array, $field) {
foreach ($array as $sub) {
$cmp[] = $sub[$field];
@@ -199,17 +196,12 @@ if (isset($argv[1])) {
if ($data['act'] != "static") {
if (($lip >= ip2ulong($config['dhcpd'][$dhcpif]['range']['from'])) && ($lip <= ip2ulong($config['dhcpd'][$dhcpif]['range']['to']))) {
$result = $result + 1;
-
}
}
else {
-
-
if (($lip >= $subnet_start) && ($lip <= $subnet_end)) {
$result_static = $result_static + 1;
}
-
-
}
}
}
OpenPOWER on IntegriCloud