mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Only enable/disable those lists where the status should be changed (efficiency + speed)
This commit is contained in:
@@ -328,15 +328,17 @@ function readAdlists(&$list, $listname)
|
||||
case "adlists":
|
||||
foreach ($adlistsdefault as $key => $value)
|
||||
{
|
||||
if(isset($_POST["adlist-".$key]))
|
||||
if(isset($_POST["adlist-".$key]) && !$value[0])
|
||||
{
|
||||
$action = "enable";
|
||||
// Is not enabled, but should be
|
||||
exec("sudo pihole -a adlist enable ".escapeshellcmd ($value[1]));
|
||||
|
||||
}
|
||||
else
|
||||
elseif(!isset($_POST["adlist-".$key]) && $value[0])
|
||||
{
|
||||
$action = "disable";
|
||||
// Is enabled, but shouldn't be
|
||||
exec("sudo pihole -a adlist disable ".escapeshellcmd ($value[1]));
|
||||
}
|
||||
exec("sudo pihole -a adlist ".$action." ".escapeshellcmd ($value[1]));
|
||||
}
|
||||
|
||||
if(strlen($_POST["newuserlists"]) > 1)
|
||||
|
||||
Reference in New Issue
Block a user