mirror of
https://github.com/unraid/webgui.git
synced 2026-01-01 06:59:56 -06:00
DRAFT Run FCP scan during diagnostics
Pending Larry approval Runs FCP scan if one hasn't been already run within 24 hours
This commit is contained in:
@@ -50,12 +50,12 @@ function write(...$messages){
|
||||
}
|
||||
curl_close($com);
|
||||
}
|
||||
function run($cmd, &$save=null) {
|
||||
function run($cmd, &$save=null, $timeout=30) {
|
||||
global $cli,$diag;
|
||||
// output command for display
|
||||
write($cmd);
|
||||
// execute command with timeout of 30s
|
||||
exec("timeout -s9 30 $cmd", $save);
|
||||
exec("timeout -s9 $timeout $cmd", $save);
|
||||
return implode("\n",$save);
|
||||
}
|
||||
|
||||
@@ -323,6 +323,12 @@ if ($cli) {
|
||||
$date = "{$split[2]}-{$split[3]}";
|
||||
}
|
||||
|
||||
// Run Fix Common Problems if present and results are old / not present
|
||||
if ( is_file("/usr/local/emhttp/plugins/fix.common.problems/scripts/scan.php") ) {
|
||||
if ( ! is_file("/tmp/fix.common.problems/errors.json") || (time() - filemtime("/tmp/fix.common.problems/errors.json")) > 86400) {
|
||||
run("/usr/local/emhttp/plugins/fix.common.problems/scripts/scan.php",$ignore,60);
|
||||
}
|
||||
}
|
||||
// don't anonymize system share names
|
||||
$vardomain = @parse_ini_file('/boot/config/domain.cfg') ?: [];
|
||||
$vardocker = @parse_ini_file('/boot/config/docker.cfg') ?: [];
|
||||
|
||||
Reference in New Issue
Block a user