Add the new "integrity check" option to debug log page

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
RD WebDesign
2022-07-10 18:46:32 -03:00
parent 85a42a9208
commit 059c4f4528
3 changed files with 39 additions and 11 deletions

View File

@@ -49,12 +49,21 @@ function echoEvent($datatext) {
}
}
// Execute "pihole" using Web option
$command = "export TERM=dumb && sudo pihole -d -w";
// Add auto-upload option
if (isset($_GET["upload"])) {
$proc = popen("export TERM=dumb && sudo pihole -d -a -w", "r");
} else {
$proc = popen("export TERM=dumb && sudo pihole -d -w", "r");
$command .= " -a";
}
// Execute database integrity_check
if (isset($_GET["dbcheck"])) {
$command .= " -c";
}
$proc = popen($command, "r");
while (!feof($proc)) {
echoEvent(fread($proc, 4096));
}