From bfad6d8fcb476935261052e5c1444aa65e454deb Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 7 Oct 2017 17:25:43 +0200 Subject: [PATCH] Add nuke option before importing new list to be sure the content is being replaced instead of appended Signed-off-by: DL6ER --- scripts/pi-hole/php/teleporter.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/pi-hole/php/teleporter.php b/scripts/pi-hole/php/teleporter.php index 34e3ab67..7e20786f 100644 --- a/scripts/pi-hole/php/teleporter.php +++ b/scripts/pi-hole/php/teleporter.php @@ -124,12 +124,14 @@ if(isset($_POST["action"])) { $blacklist = process_file(file_get_contents($file)); echo "Processing blacklist.txt
\n"; + exec("sudo pihole -b --nuke"); exec("sudo pihole -b -q ".implode(" ", $blacklist)); } if(isset($_POST["whitelist"]) && $file->getFilename() === "whitelist.txt") { $whitelist = process_file(file_get_contents($file)); echo "Processing whitelist.txt
\n"; + exec("sudo pihole -w --nuke"); exec("sudo pihole -w -q ".implode(" ", $whitelist)); } @@ -137,6 +139,7 @@ if(isset($_POST["action"])) { $wildlist = process_file(file_get_contents($file)); echo "Processing wildcardblocking.txt
\n"; + exec("sudo pihole -wild --nuke"); exec("sudo pihole -wild -q ".implode(" ", $wildlist)); } }