[fix] Fix text printed to whiptail progress bar

This commit is contained in:
William Wernert
2020-12-28 15:06:03 -05:00
parent cdb6dfcea0
commit 97466957a7
2 changed files with 5 additions and 4 deletions

View File

@@ -147,8 +147,8 @@ wait_for_apt() {
local retry_count=30
local retry_timeout='10s'
local lock_msg="Could not acquire dpkg lock, waiting $retry_timeout for lock to release."
if [ -z "$progress_callback" ]; then
if [ -z "$progress_bar_text" ]; then
if [[ -z $progress_callback ]]; then
if [[ -z $progress_bar_text ]]; then
local old_text="Installing..."
else
local old_text="$progress_bar_text"
@@ -162,7 +162,7 @@ wait_for_apt() {
if [[ -z $progress_callback ]]; then
echo " $lock_msg" | tee -a "$setup_log"
else
$progress_callback "$lock_msg (Attempt $count/$retry_count)"
$progress_callback "Could not acquire dpkg lock, waiting $retry_timeout ($count/$retry_count)"
fi
else
[[ -z $progress_callback ]] || $progress_callback "$old_text"

View File

@@ -1927,7 +1927,8 @@ setup_salt_master_dirs() {
set_progress_str() {
local percentage_input=$1
local progress_bar_text=$2
progress_bar_text=$2
export progress_bar_text
if (( "$percentage_input" >= "$percentage" )); then
percentage="$percentage_input"