Use API gateway endpoint

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König
2022-06-08 08:29:19 +02:00
parent 0ff11d6349
commit 0ccf727edd
2 changed files with 17 additions and 6 deletions

View File

@@ -544,4 +544,15 @@ function piholeStatus() {
return $ret;
}
//Returns the default gateway address and interface
function getGateway() {
$gateway= callFTLAPI("gateway");
if (array_key_exists("FTLnotrunning", $gateway)) {
$ret = array("ip" => -1);
} else {
$ret = array_combine(["ip", "iface"], explode(" ", $gateway[0]));
}
return $ret;
}
?>