diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2022-09-14 09:33:49 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2022-09-14 09:33:49 +0300 |
commit | d0e461068e64ae9aa31574a4212819f6804ee9df (patch) | |
tree | 072e9713f4b2e6009fb43c12001fdf33bf48d694 /localwebsite/handlers | |
parent | 0f1aafa6fe0be9628721b7db938053b54fe9e53d (diff) |
lws: dhcp hostname overrides (aliases)
Diffstat (limited to 'localwebsite/handlers')
-rw-r--r-- | localwebsite/handlers/ModemHandler.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/localwebsite/handlers/ModemHandler.php b/localwebsite/handlers/ModemHandler.php index aca69a3..b54b82c 100644 --- a/localwebsite/handlers/ModemHandler.php +++ b/localwebsite/handlers/ModemHandler.php @@ -146,7 +146,12 @@ class ModemHandler extends RequestHandler } public function GET_routing_dhcp_page() { + $overrides = config::get('dhcp_hostname_overrides'); $leases = MyOpenWrtUtils::getDHCPLeases(); + foreach ($leases as &$lease) { + if ($lease['hostname'] == '?' && array_key_exists($lease['mac'], $overrides)) + $lease['hostname'] = $overrides[$lease['mac']]; + } $this->tpl->set([ 'leases' => $leases ]); |