mirror of
https://github.com/pi-hole/web.git
synced 2026-04-25 11:19:59 +01:00
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:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user