Force reload of the regex filters in FTLDNS after having added/removed one from the dashboard

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2018-06-24 12:42:05 +02:00
parent 1935544183
commit c0da231fa6
2 changed files with 14 additions and 0 deletions

View File

@@ -39,6 +39,13 @@ switch($type) {
$err = error_get_last()["message"];
echo "Unable to add regex \"".htmlspecialchars($_POST['domain'])."\" to ${regexfile}<br>Error message: $err";
}
else
{
// Send SIGHUP to pihole-FTL using a frontend command
// to force reloading of the regex domains
// This will also wipe the resolver's cache
echo exec("sudo pihole restartdns reload");
}
case "audit":
echo exec("sudo pihole -a audit ${_POST['domain']}");
break;

View File

@@ -40,6 +40,13 @@ switch($type) {
$err = error_get_last()["message"];
echo "Unable to remove regex \"".htmlspecialchars($_POST['domain'])."\" from ${regexfile}<br>Error message: $err";
}
else
{
// Send SIGHUP to pihole-FTL using a frontend command
// to force reloading of the regex domains
// This will also wipe the resolver's cache
echo exec("sudo pihole restartdns reload");
}
break;
}