You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
704 B

3 years ago
3 years ago
  1. <?php
  2. require '../../includes/csrf.php';
  3. require_once '../../includes/config.php';
  4. if (isset($_POST['blocklist_id'])) {
  5. $blocklist_id = $_POST['blocklist_id'];
  6. $notracking_url = "https://raw.githubusercontent.com/notracking/hosts-blocklists/master/";
  7. switch ($blocklist_id) {
  8. case "notracking-hostnames":
  9. $file = "hostnames.txt";
  10. break;
  11. case "notracking-domains":
  12. $file = "domains.txt";
  13. break;
  14. }
  15. $blocklist = $notracking_url . $file;
  16. exec("sudo /etc/raspap/adblock/update_blocklist.sh $blocklist $file " .RASPI_ADBLOCK_LISTPATH, $return);
  17. $jsonData = ['return'=>$return];
  18. echo json_encode($jsonData);
  19. }