From ddc71e0cf4892e5a503a82666401dc0d7fd29fb9 Mon Sep 17 00:00:00 2001 From: guillem Date: Wed, 23 Jan 2019 16:09:12 -0300 Subject: [PATCH] - Corrected visualization of the gauge, no flickering now --- packages/bsp/common/usr/sbin/nand-sata-install | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/bsp/common/usr/sbin/nand-sata-install b/packages/bsp/common/usr/sbin/nand-sata-install index 5cf12bf7f2..546c373a18 100755 --- a/packages/bsp/common/usr/sbin/nand-sata-install +++ b/packages/bsp/common/usr/sbin/nand-sata-install @@ -168,12 +168,13 @@ create_armbian() # Sometimes reads the progress file while writing and only partial numbers (like 1 when is 15) prev_progress=${rsync_progress} rsync_progress=$(tail -n1 "${nsi_conn_progress}") + if [[ -z ${rsync_progress} ]]; then + rsync_progress=${prev_progress} + fi if [ ${prev_progress} -gt ${rsync_progress} ]; then rsync_progress=${prev_progress} fi - echo "${rsync_progress}" | \ - dialog --backtitle "$backtitle" --title " $title " --gauge "\n\n Transferring rootfs to $2 ($USAGE MB). \n\n \ - This will take approximately $(( $((USAGE/300)) * 1 )) minutes to finish. Please wait!\n\n" 11 80 + echo "${rsync_progress}" # finish the while if the rsync is finished rsync_done=$(cat ${nsi_conn_done}) if [[ "${rsync_done}" != "no" ]]; then @@ -189,7 +190,9 @@ create_armbian() sleep 0.5 fi - done + done | \ + dialog --backtitle "$backtitle" --title " $title " --gauge "\n\n Transferring rootfs to $2 ($USAGE MB). \n\n \ + This will take approximately $(( $((USAGE/300)) * 1 )) minutes to finish. Please wait!\n\n" 11 80 # run rsync again to silently catch outstanding changes between / and ${TempDir}/rootfs/ dialog --title "$title" --backtitle "$backtitle" --infobox "\n Cleaning up ... Almost done." 5 40