fix $check_only parameter and a little nicer cli formatting

This commit is contained in:
ralf 2024-02-27 17:04:06 +02:00
parent 37a9711b19
commit 00bf97eaeb

View File

@ -24,15 +24,13 @@ $GLOBALS['egw_info'] = [
]; ];
require(dirname(__DIR__).'/header.inc.php'); require(dirname(__DIR__).'/header.inc.php');
$msgs = Sqlfs\Utils::fsck([ $msgs = Sqlfs\Utils::fsck($check_only = ($_SERVER['argv'][1] ?? '') !== '--yes');
'check_only' => $check_only = ($_SERVER['argv'][1] ?? '') !== '--yes',
]);
echo implode("\n", $msgs)."\n"; echo implode("\n", $msgs)."\n";
if (!$msgs) if (!$msgs)
{ {
error_log("fsck found NO problems :)"); echo "fsck found NO problems :)\n";
} }
elseif ($check_only) elseif ($check_only)
{ {
error_log('Use --yes to fix problems found'); echo "\nUse --yes to fix problems found\n";
} }