From d7291cdb5355982de750fc02a59ca4a834c16df0 Mon Sep 17 00:00:00 2001 From: Simone Caronni Date: Mon, 21 Oct 2024 09:33:14 +0200 Subject: [PATCH] Fix issue #450 --- dkms.in | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/dkms.in b/dkms.in index c01c7315..741c7a51 100644 --- a/dkms.in +++ b/dkms.in @@ -106,11 +106,11 @@ invoke_command() [[ $verbose ]] && echo -e "$cmd" || echo -en "$cmd_description..." if [[ $cmd_mode == background && ! $verbose && $package_name != dkms*_test ]]; then - while true ; do - sleep 3 - echo -n "." - done & - progresspid=$! + while true ; do + sleep 3 + echo -n "." + done & + progresspid=$! fi if [[ -n "$cmd_output_file" ]]; then @@ -120,11 +120,14 @@ invoke_command() ( eval "$cmd" ) >/dev/null 2>&1 exitval=$? else - ( eval "$cmd" ) - exitval=$? + ( eval "$cmd" ) + exitval=$? fi - [ -n "$progresspid" ] && kill "$progresspid" >/dev/null 2>&1 + if [ -n "$progresspid" ]; then + kill "$progresspid" >/dev/null 2>&1 + wait "$progresspid" 2>/dev/null + fi if (( exitval > 0)); then echo -en "(bad exit status: $exitval)"