mirror of
https://github.com/pi-hole/web.git
synced 2026-04-25 11:19:59 +01:00
Automatically restart DNS resolver when privacy level is lowered
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -687,8 +687,25 @@ function readAdlists()
|
||||
$level = intval($_POST["privacylevel"]);
|
||||
if($level >= 0 && $level <= 4)
|
||||
{
|
||||
// Check if privacylevel is already set
|
||||
if (isset($piholeFTLConf["PRIVACYLEVEL"])) {
|
||||
$privacylevel = intval($piholeFTLConf["PRIVACYLEVEL"]);
|
||||
} else {
|
||||
$privacylevel = 0;
|
||||
}
|
||||
|
||||
// Store privacy level
|
||||
exec("sudo pihole -a privacylevel ".$level);
|
||||
$success .= "The privacy level has been updated";
|
||||
|
||||
if($privacylevel > $level)
|
||||
{
|
||||
exec("sudo pihole -a restartdns");
|
||||
$success .= "The privacy level has been decreased and the DNS resolver has been restarted";
|
||||
}
|
||||
else
|
||||
{
|
||||
$success .= "The privacy level has been increased";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user