mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 12:48:29 +00:00
Added online debug log creator
This commit is contained in:
19
scripts/pi-hole/php/debug.php
Normal file
19
scripts/pi-hole/php/debug.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
ob_end_flush();
|
||||
ini_set("output_buffering", "0");
|
||||
ob_implicit_flush(true);
|
||||
header('Content-Type: text/event-stream');
|
||||
header('Cache-Control: no-cache');
|
||||
|
||||
function echoEvent($datatext) {
|
||||
if(!isset($_GET["IE"]))
|
||||
echo "data: ".implode("\ndata: ", explode("\n", $datatext))."\n\n";
|
||||
else
|
||||
echo $datatext;
|
||||
}
|
||||
|
||||
$proc = popen("sudo pihole -d -a", "r");
|
||||
while (!feof($proc)) {
|
||||
echoEvent(fread($proc, 4096));
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user