Fix false positive error outputs

https://forum.virtualmin.com/t/force-logrotate-fails/107301
This commit is contained in:
Ilia Rostovtsev
2020-08-31 16:06:22 +03:00
parent 677948bd9a
commit 66ac2ba10f

View File

@ -12,8 +12,13 @@ print $text{'force_doing'},"\n";
&clean_environment();
$out = &backquote_logged("$config{'logrotate'} -f $config{'logrotate_conf'} 2>&1");
&reset_environment();
print "<pre>$out</pre>";
if ($?) {
if ($out) {
print "<pre>$out</pre>";
}
else {
print "<br>";
}
if ($? && $out) {
print $text{'force_failed'},"<br>\n";
}
else {