From 0635b2ae5e8d9ac541adff036919ab428da30b58 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Wed, 5 Jan 2022 12:52:45 -0300 Subject: [PATCH] Add flag in checkForSystemdUnit() --- install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index dca825c..86d3b13 100755 --- a/install.sh +++ b/install.sh @@ -453,12 +453,13 @@ getDotfiles() { } checkForSystemdUnit() { - trap 'systemctl stop ${2}' INT + trap 'systemctl stop ${2}; forceExit=true' INT systemctl is-active --quiet ${2} [ $? -eq 0 ] && return + forceExit=false calcWidthAndRun "whiptail --infobox \"Waiting for the ${1} to finish.\" 7 WIDTH" systemctl is-active --quiet ${2} - while [ $? -ne 0 ]; do + while [ $? -ne 0 ] && [ $forceExit = false ]; do sleep 1 systemctl is-active --quiet ${2} done