1
0
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:
billz 2025-03-16 03:29:19 -07:00
parent 8a7c954d88
commit 6c47375d18

View File

@ -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;
}
}