Skip to content

Commit

Permalink
minor bugfix sysinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
outdoorbits committed Dec 6, 2024
1 parent b8cb5e8 commit da24152
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
7 changes: 6 additions & 1 deletion scripts/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,12 @@ def finish(self):
) == True # else could be None

# generate thumbnails in secondary backup while uploading?
shiftGenerateThumbnails = SecondaryBackupFollows and (args['TargetName'] == args['SecSourceName']) and (lib_storage.extractCloudService(args['SecTargetName'])[0] in ['cloud', 'cloud_rsync'])
shiftGenerateThumbnails = ( \
SecondaryBackupFollows and \
(args['TargetName'] == args['SecSourceName']) and \
(args['TargetName'] in ['internal', 'usb', 'nvme']) and \
(lib_storage.extractCloudService(args['SecTargetName'])[0] in ['cloud', 'cloud_rsync'])
)

# primary backup
if SecondaryBackupFollows:
Expand Down
35 changes: 18 additions & 17 deletions scripts/sysinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,29 +130,30 @@
$DeviceIdentifier = '';
}

echo ("<tr><th style='vertical-align:top;'>$Lum</th><td style='padding-left: 10px;'>");
if ($Lum) {
echo ("<tr><th style='vertical-align:top;'>$Lum</th><td style='padding-left: 10px;'>");

unset($States);
exec("sudo smartctl -a $Lum", $States);
unset($States);
exec("sudo smartctl -a $Lum", $States);

$StatusMessage = '';
foreach($States as $Line) {
if (strpos($Line, ': ')) {
$output = true;
$StatusMessage = '';
foreach($States as $Line) {
if (strpos($Line, ': ')) {
$output = true;

list($Value, $measured) = explode(':', $Line, 2);
$Value = str_pad(trim($Value) . ':', 35, ' ');
$measured = trim($measured);
list($Value, $measured) = explode(':', $Line, 2);
$Value = str_pad(trim($Value) . ':', 35, ' ');
$measured = trim($measured);

echo ($Value . $measured . '<br>');
echo ($Value . $measured . '<br>');
}
}
}

if (! $output) {
echo ('-');
}

echo ("</td></tr>");
echo ("</td></tr>");
}
}
if (! $output) {
echo ('<tr><td>-</td></tr>');
}
echo '</table></pre>';
?>
Expand Down

0 comments on commit da24152

Please sign in to comment.