mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 02:39:25 +01:00
Use piholeStatus() in header.php (#2062)
* Use piholeStatus() in header.php Signed-off-by: Christian König <ckoenig@posteo.de> * Remove check for null Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
require "scripts/pi-hole/php/auth.php";
|
||||
require "scripts/pi-hole/php/password.php";
|
||||
require_once "scripts/pi-hole/php/FTL.php";
|
||||
require_once "scripts/pi-hole/php/func.php";
|
||||
require "scripts/pi-hole/php/theme.php";
|
||||
$scriptname = basename($_SERVER['SCRIPT_FILENAME']);
|
||||
$hostname = gethostname() ? gethostname() : "";
|
||||
@@ -333,19 +334,14 @@ if($auth) {
|
||||
<div class="pull-left info">
|
||||
<p>Status</p>
|
||||
<?php
|
||||
$pistatus = pihole_execute('status web');
|
||||
if (isset($pistatus[0])) {
|
||||
$pistatus = intval($pistatus[0]);
|
||||
} else {
|
||||
$pistatus = null;
|
||||
}
|
||||
$pistatus = piholeStatus();
|
||||
if ($pistatus == 53) {
|
||||
echo '<span id="status"><i class="fa fa-w fa-circle text-green-light"></i> Active</span>';
|
||||
} elseif ($pistatus == 0) {
|
||||
echo '<span id="status"><i class="fa fa-w fa-circle text-red"></i> Offline</span>';
|
||||
} elseif ($pistatus == -1) {
|
||||
echo '<span id="status"><i class="fa fa-w fa-circle text-red"></i> DNS service not running</span>';
|
||||
} elseif ($pistatus == -2 || is_null($pistatus)) {
|
||||
} elseif ($pistatus == -2) {
|
||||
echo '<span id="status"><i class="fa fa-w fa-circle text-red"></i> Unknown</span>';
|
||||
} else {
|
||||
echo '<span id="status"><i class="fa fa-w fa-circle text-orange"></i> DNS service on port '.$pistatus.'</span>';
|
||||
|
||||
Reference in New Issue
Block a user