mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-07-24 21:38:06 +02:00
Create adBlockStatus()
This commit is contained in:
parent
8a7c954d88
commit
6c47375d18
@ -155,5 +155,21 @@ class Sysinfo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if ad blocking is enabled and active
|
||||
*/
|
||||
public function adBlockStatus(): bool
|
||||
{
|
||||
exec('cat '. RASPI_ADBLOCK_CONFIG, $return);
|
||||
$arrConf = ParseConfig($return);
|
||||
if (sizeof($arrConf) > 0) {
|
||||
$enabled = true;
|
||||
}
|
||||
exec('pidof dnsmasq | wc -l', $dnsmasq);
|
||||
$dnsmasq_state = ($dnsmasq[0] > 0);
|
||||
$status = $dnsmasq_state && $enabled ? true : false;
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user