Refactor
This commit is contained in:
parent
bd70e3800d
commit
af8e58b646
|
@ -25,13 +25,7 @@ updateSystemClock() {
|
||||||
|
|
||||||
printAndExit() {
|
printAndExit() {
|
||||||
str="${1} Therefore, the installation process will stop, but you can continue where you left off by running:\n\nsh calsais"
|
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')
|
calcHeightAndRun "whiptail --msgbox \"${str}\" HEIGHT 60"
|
||||||
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
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue