diff --git a/src/RaspAP/System/Sysinfo.php b/src/RaspAP/System/Sysinfo.php index 7f5fbe09..0cb84f07 100755 --- a/src/RaspAP/System/Sysinfo.php +++ b/src/RaspAP/System/Sysinfo.php @@ -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; + } }