[fix] Correct logic for service check + bash trap

This commit is contained in:
William Wernert
2020-12-03 10:18:44 -05:00
parent af8295a651
commit 76fff28dfa
2 changed files with 5 additions and 7 deletions

View File

@@ -1404,7 +1404,7 @@ reinstall_init() {
local pid=$!
local count=0
while check_service_status "$service"; do
while ! (check_service_status "$service"); do
if [[ $count -gt $service_retry_count ]]; then
echo "Could not stop $service after 1 minute, exiting setup."

View File

@@ -485,14 +485,12 @@ fi
# Exit parent script if
trap 'catch $? $LINENO' SIGUSR1
trap 'catch $LINENO' SIGUSR1
catch() {
if [ "$1" != 0 ]; then
info "Fatal error occurred at $2 in so-setup, failing setup."
whiptail_setup_failed
exit
fi
info "Fatal error occurred at $2 in so-setup, failing setup."
whiptail_setup_failed
exit
}
# Begin install