From af8e58b64664c493489dfe317e838af61009a8b3 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Thu, 27 Jan 2022 22:37:02 -0300 Subject: [PATCH] Refactor --- install.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/install.sh b/install.sh index 4fa4b66..a0852b5 100755 --- a/install.sh +++ b/install.sh @@ -25,13 +25,7 @@ updateSystemClock() { printAndExit() { str="${1} Therefore, the installation process will stop, but you can continue where you left off by running:\n\nsh calsais" - newlines=$(printf "$str" | grep -c $'\n') - chars=$(echo "$str" | wc -c) - height=$(echo "$chars" "$newlines" | awk '{ - x = (($1 - $2 + ($2 * 60)) / 60) - printf "%d", (x == int(x)) ? x : int(x) + 1 - }') - whiptail --msgbox "$str" $((5+height)) 60 3>&1 1>&2 2>&3 + calcHeightAndRun "whiptail --msgbox \"${str}\" HEIGHT 60" exit 1 }