24 lines
415 B
PHP
Executable File
24 lines
415 B
PHP
Executable File
<?php
|
|
// get_log.php
|
|
|
|
header('Content-Type: text/plain; charset=UTF-8');
|
|
|
|
$logFile = '/var/www/nix.roulaise.net/status/qt-temp/qtw*/temp/build.log';
|
|
$lines = 50;
|
|
|
|
$command = sprintf(
|
|
'tail -n %d %s 2>&1',
|
|
$lines,
|
|
escapeshellarg($logFile)
|
|
);
|
|
|
|
$output = shell_exec($command);
|
|
|
|
if ($output === null) {
|
|
http_response_code(500);
|
|
echo "Error: Unable to read log file.\n";
|
|
exit;
|
|
}
|
|
|
|
echo $output;
|