1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00
raspap-webgui/ajax/adblock/update_blocklist.php

25 lines
704 B
PHP
Raw Normal View History

2020-03-27 09:46:13 +01:00
<?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/";
switch ($blocklist_id) {
case "notracking-hostnames":
$file = "hostnames.txt";
break;
case "notracking-domains":
$file = "domains.txt";
break;
}
$blocklist = $notracking_url . $file;
2020-03-27 23:05:10 +01:00
exec("sudo /etc/raspap/adblock/update_blocklist.sh $blocklist $file " .RASPI_ADBLOCK_LISTPATH, $return);
2020-03-27 10:24:48 +01:00
$jsonData = ['return'=>$return];
echo json_encode($jsonData);
2020-03-27 09:46:13 +01:00
}