Make selectable what should be imported from the uploaded archive

This commit is contained in:
DL6ER
2017-01-20 16:35:44 +01:00
parent 4633f800ab
commit 9d09d61b7f
2 changed files with 41 additions and 13 deletions

View File

@@ -85,14 +85,24 @@ if($_POST["action"] == "in")
$zip = new ZipArchive();
$x = $zip->open($source);
if ($x === true) {
$blacklist = process_zip("blacklist.txt");
echo exec("sudo pihole -b -q ".implode(" ", $blacklist));
if(isset($_POST["blacklist"]))
{
$blacklist = process_zip("blacklist.txt");
exec("sudo pihole -b -q ".implode(" ", $blacklist));
}
$whitelist = process_zip("whitelist.txt");
echo exec("sudo pihole -w -q ".implode(" ", $whitelist));
if(isset($_POST["whitelist"]))
{
$whitelist = process_zip("whitelist.txt");
echo exec("sudo pihole -w -q ".implode(" ", $whitelist));
}
if(isset($_POST["wildlist"]))
{
$wildlist = process_zip("wildcardblocking.txt");
echo exec("sudo pihole -wild -q ".implode(" ", $wildlist));
}
$wildlist = process_zip("wildcardblocking.txt");
echo exec("sudo pihole -wild -q ".implode(" ", $wildlist));
$zip->close();
}
else