mirror of
https://github.com/pi-hole/web.git
synced 2026-04-25 19:29:20 +01:00
Check for existance and readability of static leases file before trying to access it.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -79,16 +79,10 @@ function readStaticLeasesFile($origin_file="/etc/dnsmasq.d/04-pihole-static-dhcp
|
||||
{
|
||||
global $dhcp_static_leases;
|
||||
$dhcp_static_leases = array();
|
||||
try
|
||||
{
|
||||
$dhcpstatic = @fopen($origin_file, 'r');
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
echo "Warning: Failed to read ".$origin_file.", this is not an error";
|
||||
if(!file_exists($origin_file) || !is_readable($origin_file))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$dhcpstatic = @fopen($origin_file, 'r');
|
||||
if(!is_resource($dhcpstatic))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user