mirror of
https://github.com/unraid/webgui.git
synced 2026-04-27 13:29:42 -05:00
Refactor: Identify Safemode in diagnostics filename
This commit is contained in:
@@ -361,7 +361,9 @@ if ($cli) {
|
||||
echo "Starting diagnostics collection... ";
|
||||
$server = isset($var['NAME']) ? str_replace(' ','_',strtolower($var['NAME'])) : 'tower';
|
||||
$date = date('Ymd-Hi');
|
||||
$diag = "$server-diagnostics-$date";
|
||||
|
||||
$safeMode = (_var($var,'safeMode') == 'yes') ? "-safemode" : "";
|
||||
$diag = "$server$safeMode-diagnostics-$date";
|
||||
$zip = "/boot/logs/$diag.zip";
|
||||
} else {
|
||||
// script is called from GUI
|
||||
@@ -430,11 +432,6 @@ foreach (glob("$path/*.ini") as $file) {
|
||||
if ($all || $ini != "users") file_put_contents("/$diag/system/vars.txt",preg_replace(["/\n/","/^Array/"],["\r\n",$ini],anonymize(print_r(parse_ini_file($file,true),true),1)),FILE_APPEND);
|
||||
}
|
||||
|
||||
// check for safe mode
|
||||
if (_var($var,'safeMode') == 'yes') {
|
||||
file_put_contents("/$diag/system/safemode.txt", "Unraid safe mode enabled\r\n");
|
||||
}
|
||||
|
||||
// Create loads.txt
|
||||
$cpuload = run("uptime")." Cores: ".run("nproc")."\r\n".(string)@file_get_contents("$path/cpuload.ini")."\r\n";
|
||||
$loadTxt = [];
|
||||
|
||||
Reference in New Issue
Block a user