diff --git a/bandwidth/lang/en b/bandwidth/lang/en index c961343db..541aabbf5 100644 --- a/bandwidth/lang/en +++ b/bandwidth/lang/en @@ -85,6 +85,7 @@ syslog_syslog-ng=Syslog-NG rotate_title=Updating Statistics rotate_doing=Processing logged network traffic .. -rotate_done=.. done. +rotate_done=.. done +rotate_failed=.. failed : $1 __norefs=1 diff --git a/bandwidth/rotate.cgi b/bandwidth/rotate.cgi index 4273962f3..ab0c92842 100755 --- a/bandwidth/rotate.cgi +++ b/bandwidth/rotate.cgi @@ -2,18 +2,11 @@ # Run rotate.pl now require './bandwidth-lib.pl'; -&ui_print_header(undef, $text{'rotate_title'}, ""); - -print "$text{'rotate_doing'}\n"; -print "
"; -open(OUT, "$cron_cmd 2>&1 |"); -while(\n"; -print "$text{'rotate_done'}) { - print &html_escape($_); - } -close(OUT); -print "
\n";
-
+&ui_print_unbuffered_header(undef, $text{'rotate_title'}, "");
+print &ui_text_wrap($text{'rotate_doing'});
+my ($out) = &backquote_logged("$cron_cmd 2>&1");
+$out = $out ? &text('rotate_failed', &html_strip($out)) : $text{'rotate_done'};
+print &ui_text_wrap("
$out");
&webmin_log("rotate");
&ui_print_footer("", $text{'index_return'});