mirror of
https://github.com/pi-hole/web.git
synced 2026-04-23 02:09:58 +01:00
Change pihole status in api_FTL.php (#2059)
Using "pihole status web" info Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>
This commit is contained in:
23
api.php
23
api.php
@@ -19,28 +19,7 @@ $data = array();
|
||||
|
||||
// Common API functions
|
||||
if (isset($_GET['status'])) {
|
||||
// Receive the return of "pihole status web"
|
||||
$pistatus = pihole_execute('status web');
|
||||
|
||||
if (isset($pistatus[0])) {
|
||||
$pistatus = intval($pistatus[0]);
|
||||
} else {
|
||||
// If no response, status="Unknown" (-2)
|
||||
$pistatus = -2;
|
||||
}
|
||||
|
||||
switch ($pistatus) {
|
||||
case -2: // Unkown
|
||||
case -1: // DNS service not running"
|
||||
case 0: // Offline
|
||||
$data = array_merge($data, array("status" => "disabled"));
|
||||
break;
|
||||
|
||||
default:
|
||||
// DNS service on port $returncode
|
||||
$data = array_merge($data, array("status" => "enabled"));
|
||||
}
|
||||
|
||||
$data = array_merge($data, array("status" => piholeStatusAPI()));
|
||||
} elseif (isset($_GET['enable']) && $auth) {
|
||||
if(isset($_GET["auth"]))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user