Add nuke option before importing new list to be sure the content is being replaced instead of appended

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2017-10-07 17:25:43 +02:00
parent 02807730ee
commit bfad6d8fcb

View File

@@ -124,12 +124,14 @@ if(isset($_POST["action"]))
{
$blacklist = process_file(file_get_contents($file));
echo "Processing blacklist.txt<br>\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<br>\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<br>\n";
exec("sudo pihole -wild --nuke");
exec("sudo pihole -wild -q ".implode(" ", $wildlist));
}
}