mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-07-06 17:27:42 +02:00
Check for presence of custom blocklist in RASPI_ADBLOCK_LISTPATH
This commit is contained in:
parent
125ae7a39a
commit
a21b0a8f99
@ -40,7 +40,6 @@ function DisplayAdBlockConfig()
|
||||
file_put_contents("/tmp/dnsmasq_custom", $_POST['adblock-custom-hosts'].PHP_EOL);
|
||||
system("sudo cp /tmp/dnsmasq_custom " .RASPI_ADBLOCK_LISTPATH .'custom.txt', $return);
|
||||
$config.= 'addn-hosts=' .RASPI_ADBLOCK_LISTPATH .'custom.txt'.PHP_EOL;
|
||||
$custom_enabled = true;
|
||||
}
|
||||
|
||||
if (empty($errors)) {
|
||||
@ -64,6 +63,13 @@ function DisplayAdBlockConfig()
|
||||
}
|
||||
}
|
||||
|
||||
$custom_list = RASPI_ADBLOCK_LISTPATH . 'custom.txt';
|
||||
$custom_enabled = false;
|
||||
|
||||
if (file_exists($custom_list) && filesize($custom_list) > 0) {
|
||||
$custom_enabled = true;
|
||||
}
|
||||
|
||||
exec('cat '. RASPI_ADBLOCK_CONFIG, $return);
|
||||
$arrConf = ParseConfig($return);
|
||||
if (sizeof($arrConf) > 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user