summaryrefslogtreecommitdiffstats
path: root/etc/inc/pfsense-utils.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2012-08-01 10:40:41 +0000
committerErmal <eri@pfsense.org>2012-08-01 10:40:41 +0000
commit03b2cab6ded9f6722cafb3ac2356fd9477b99c3b (patch)
tree7265a238f78b0bf5a80f4b1a936e99d9cd71bfdb /etc/inc/pfsense-utils.inc
parent74a4edc36f4bc686023066a82a76df3283760d3a (diff)
downloadpfsense-03b2cab6ded9f6722cafb3ac2356fd9477b99c3b.zip
pfsense-03b2cab6ded9f6722cafb3ac2356fd9477b99c3b.tar.gz
To not clobber the console add \r when outputing status information on console
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r--etc/inc/pfsense-utils.inc40
1 files changed, 20 insertions, 20 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index eaa416d..e871cbc 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1673,25 +1673,25 @@ function read_body($ch, $string) {
$downloadProgress = 0;
if($lastseen <> $downloadProgress and $downloadProgress < 101) {
if($sendto == "status") {
- if($pkg_interface == "console") {
- if(substr($downloadProgress,2,1) == "0" || count($downloadProgress) < 2) {
- $tostatus = $static_status . $downloadProgress . "%";
- update_status($tostatus);
- }
- } else {
- $tostatus = $static_status . $downloadProgress . "%";
- update_status($tostatus);
- }
+ if($pkg_interface == "console") {
+ if(substr($downloadProgress,2,1) == "0" || count($downloadProgress) < 2) {
+ $tostatus = $static_status . $downloadProgress . "%";
+ update_status($tostatus);
+ }
+ } else {
+ $tostatus = $static_status . $downloadProgress . "%";
+ update_status($tostatus);
+ }
} else {
- if($pkg_interface == "console") {
- if(substr($downloadProgress,2,1) == "0" || count($downloadProgress) < 2) {
- $tooutput = $static_output . $downloadProgress . "%";
- update_output_window($tooutput);
- }
- } else {
- $tooutput = $static_output . $downloadProgress . "%";
- update_output_window($tooutput);
- }
+ if($pkg_interface == "console") {
+ if(substr($downloadProgress,2,1) == "0" || count($downloadProgress) < 2) {
+ $tooutput = $static_output . $downloadProgress . "%";
+ update_output_window($tooutput);
+ }
+ } else {
+ $tooutput = $static_output . $downloadProgress . "%";
+ update_output_window($tooutput);
+ }
}
update_progress_bar($downloadProgress);
$lastseen = $downloadProgress;
@@ -1723,7 +1723,7 @@ function update_output_window($text) {
function update_status($status) {
global $pkg_interface;
if($pkg_interface == "console") {
- echo $status . "\n";
+ echo "\r{$status}";
} else {
echo "\n<script type=\"text/javascript\">this.document.forms[0].status.value=\"" . $status . "\";</script>";
}
@@ -1742,7 +1742,7 @@ function update_progress_bar($percent) {
echo "\ndocument.progressbar.style.width='" . $percent . "%';";
echo "\n</script>";
} else {
- echo " {$percent}%";
+ echo "\r {$percent}%";
}
}
OpenPOWER on IntegriCloud