Show warning in browser when fopen() failed

This commit is contained in:
DL6ER
2017-05-16 18:44:08 +02:00
parent b6da032d60
commit 3e8fe365f4

View File

@@ -21,6 +21,11 @@ else
$file = fopen("/var/log/pihole.log","r");
}
if(!$file)
{
die(json_encode(array("offset" => 0, "lines" => array("Failed to open log file. Check permissions!\n"))));
}
if(isset($_GET["offset"]))
{
$offset = intval($_GET['offset']);