'', chr(27).'[1;32m' => '', chr(27).'[1;33m' => '', chr(27).'[1;34m' => '', chr(27).'[1;35m' => '', chr(27).'[1;36m' => '', chr(27).'[90m' => '', chr(27).'[91m' => '', chr(27).'[32m' => '', chr(27).'[33m' => '', chr(27).'[94m' => '', chr(27).'[95m' => '', chr(27).'[96m' => '', chr(27).'[1m' => '', chr(27).'[4m' => '', chr(27).'[0m' => '', ); $data = str_replace(array_keys($ANSIcolors), $ANSIcolors, htmlspecialchars($datatext)); if (!isset($_GET['IE'])) { echo 'data: '.implode("\ndata: ", explode("\n", $data))."\n\n"; } else { echo $data; } } // Execute "pihole" using Web option $command = 'export TERM=dumb && sudo pihole -d -w'; // Add auto-upload option if (isset($_GET['upload'])) { $command .= ' -a'; } // Execute database integrity_check if (isset($_GET['dbcheck'])) { $command .= ' -c'; } $proc = popen($command, 'r'); while (!feof($proc)) { echoEvent(fread($proc, 4096)); }