From 78d262d7b050db8aa96d0a8ec793f91f5fe93d6f Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 10 Aug 2018 18:25:12 +0200 Subject: [PATCH] Offer possibility to import auditlog.list from teleporter archive Signed-off-by: DL6ER --- scripts/pi-hole/php/teleporter.php | 8 ++++++++ settings.php | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/scripts/pi-hole/php/teleporter.php b/scripts/pi-hole/php/teleporter.php index dbdb637d..9cf280bd 100644 --- a/scripts/pi-hole/php/teleporter.php +++ b/scripts/pi-hole/php/teleporter.php @@ -143,6 +143,14 @@ if(isset($_POST["action"])) $importedsomething = true; } + if(isset($_POST["auditlog"]) && $file->getFilename() === "auditlog.list") + { + $auditlog = process_file(file_get_contents($file)); + echo "Processing auditlog.list (".count($auditlog)." entries)
\n"; + exec("sudo pihole -a clearaudit"); + exec("sudo pihole -a audit ".implode(" ",$auditlog)); + } + if($importedsomething) { exec("sudo pihole restartdns"); diff --git a/settings.php b/settings.php index dfe348bf..8ff665f1 100644 --- a/settings.php +++ b/settings.php @@ -1099,6 +1099,11 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists" checked> Regex filters +
+ +