mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Initial commit
This commit is contained in:
parent
ae26f948a4
commit
0d18432343
25
ajax/adblock/update_blocklist.php
Normal file
25
ajax/adblock/update_blocklist.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require '../../includes/csrf.php';
|
||||
require_once '../../includes/config.php';
|
||||
|
||||
if (isset($_POST['blocklist_id'])) {
|
||||
$blocklist_id = $_POST['blocklist_id'];
|
||||
$notracking_url = "https://raw.githubusercontent.com/notracking/hosts-blocklists/master/";
|
||||
$dnsmasq_config = "/etc/dnsmasq.d/";
|
||||
|
||||
switch ($blocklist_id) {
|
||||
case "notracking-hostnames":
|
||||
$file = "hostnames.txt";
|
||||
break;
|
||||
case "notracking-domains":
|
||||
$file = "domains.txt";
|
||||
break;
|
||||
}
|
||||
$blocklist = $notracking_url . $file;
|
||||
|
||||
exec("sudo /etc/raspap/adblock/update_blocklist.sh $blocklist $file $dnsmasq_config", $return);
|
||||
|
||||
echo json_encode($return);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user