mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 10:50:23 +01:00
Also allow (manually set dhcp-host=hostname,ip.add.re.ss) in table. As this has been added manually, don't allow deleting it
This commit is contained in:
@@ -53,7 +53,7 @@ function readStaticLeasesFile()
|
||||
// Remove any possibly existing variable with this name
|
||||
$mac = ""; $one = ""; $two = "";
|
||||
sscanf(trim(fgets($dhcpstatic)),"dhcp-host=%[^,],%[^,],%[^,]",$mac,$one,$two);
|
||||
if(strlen($mac) > 0)
|
||||
if(strlen($mac) > 0 && validMAC($mac))
|
||||
{
|
||||
if(validIP($one) && strlen($two) == 0)
|
||||
array_push($dhcp_static_leases,["hwaddr"=>$mac, "IP"=>$one, "host"=>""]);
|
||||
@@ -62,6 +62,10 @@ function readStaticLeasesFile()
|
||||
else
|
||||
array_push($dhcp_static_leases,["hwaddr"=>$mac, "IP"=>$one, "host"=>$two]);
|
||||
}
|
||||
else if(validIP($one) && validDomain($mac))
|
||||
{
|
||||
array_push($dhcp_static_leases,["hwaddr"=>"", "IP"=>$one, "host"=>$mac]);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user