From 3fab8bfeff31f11cfc050cfb5e8f0fd70ab44543 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Thu, 6 Jan 2022 11:09:25 -0300 Subject: [PATCH] Add printStepIfDebug() --- install.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 2cfca57..d6799c0 100755 --- a/install.sh +++ b/install.sh @@ -502,6 +502,14 @@ checkForSystemdUnit() { trap - INT } +printStepIfDebug() { + if [ $debugFlagToFile = true ] || [ $debugFlag = true ]; then + printf '\n%s' "============================================================" >> CocoASAIS.log + printf '\n%s\n' "$step" >> CocoASAIS.log + printf '%s\n' "============================================================" >> CocoASAIS.log + fi +} + steps=( checkUefi updateSystemClock @@ -567,7 +575,7 @@ runScript() { while [ $i -lt "${#steps[@]}" ]; do step=${steps[$i]} - [[ $debugFlagToStdout = true || $debugFlag = true ]] && printf '\n---\n%s\n---\n' "$step" >> CocoASAIS.log + printStepIfDebug saveVar "lastStep" "$step" $step ((i++))