From a2450b409c94e65782a4045585f8acf2645d0b40 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Sun, 2 Jan 2022 16:11:16 -0300 Subject: [PATCH] Refactor --- install.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index b7be9b2..41e8934 100755 --- a/install.sh +++ b/install.sh @@ -11,10 +11,6 @@ formatOptions() { done } -logStep() { - echo ${1} > CocoASAIS.log -} - checkUefi() { ls /sys/firmware/efi/efivars > /dev/null 2>&1 if [ $? -ge 1 ]; then @@ -26,6 +22,10 @@ updateSystemClock() { timedatectl set-ntp true } +logStep() { + echo ${1} > CocoASAIS.log +} + logAndExit() { str="${1} Therefore, the installation process will stop, but you can continue where you left off by running:\n\nsh CocoASAIS" newlines=$(printf "$str" | grep -c $'\n') @@ -35,7 +35,7 @@ logAndExit() { printf "%d", (x == int(x)) ? x : int(x) + 1 }') whiptail --msgbox "$str" $((5+height)) 60 - echo "${2}" > CocoASAIS.log + logStep "${2}" exit 1 }