mirror of
https://github.com/pi-hole/web.git
synced 2026-04-23 18:29:43 +01:00
Be less specific, as this feature can be used for any time of local resolver running on a custom port
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -200,32 +200,31 @@ function readAdlists()
|
||||
}
|
||||
$DNSservercount = count($DNSservers);
|
||||
|
||||
// Check if at least one DNS server has been added
|
||||
if(isset($_POST["localrecursive"]))
|
||||
if(isset($_POST["localDNS"]))
|
||||
{
|
||||
if(isset($_POST["localrecursiveport"]) &&
|
||||
is_numeric($_POST["localrecursiveport"]))
|
||||
if(isset($_POST["localDNSport"]) &&
|
||||
is_numeric($_POST["localDNSport"]))
|
||||
{
|
||||
// Save port and modify dnsmasq.d config file
|
||||
exec("sudo pihole -a localrecursivedns ".intval($_POST["localrecursiveport"]));
|
||||
exec("sudo pihole -a localdnsport ".intval($_POST["localDNSport"]));
|
||||
$DNSservercount++;
|
||||
}
|
||||
else if(isset($localrecursive))
|
||||
else if(isset($localdns))
|
||||
{
|
||||
// Remove entry without valid port
|
||||
exec("sudo pihole -a localrecursivedns 0");
|
||||
exec("sudo pihole -a localdnsport 0");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Remove possible entry if unticked
|
||||
|
||||
exec("sudo pihole -a localrecursivedns 0");
|
||||
// Check if at least one DNS server has been added
|
||||
if($DNSservercount < 1)
|
||||
{
|
||||
$error .= "No DNS server has been selected.<br>";
|
||||
}
|
||||
exec("sudo pihole -a localdnsport 0");
|
||||
}
|
||||
// Check if at least one DNS server has been added
|
||||
if($DNSservercount < 1)
|
||||
{
|
||||
$error .= "No DNS server has been selected.<br>";
|
||||
}
|
||||
|
||||
// Check if domain-needed is requested
|
||||
|
||||
Reference in New Issue
Block a user