Added online debug log creator

This commit is contained in:
DL6ER
2017-02-10 12:22:59 +01:00
parent ee41dbdc70
commit 9765b38ec2
4 changed files with 107 additions and 1 deletions

View 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));
}
?>