From: Timo Sirainen Date: Mon, 20 Oct 2025 11:09:45 +0000 (+0300) Subject: util: health-check.sh - Don't leave "sleep 10" process running X-Git-Tag: 2.4.2~39 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6ee85b80857d241622a349aac47d51b70b27cc46;p=thirdparty%2Fdovecot%2Fcore.git util: health-check.sh - Don't leave "sleep 10" process running --- diff --git a/src/util/health-check.sh b/src/util/health-check.sh index 4604f4e12f..99f9299bec 100755 --- a/src/util/health-check.sh +++ b/src/util/health-check.sh @@ -20,9 +20,14 @@ trap "exit 0" QUIT sleep $timeout kill -3 $$ 2>/dev/null } & -read -r input +timeout_pid=$! +read -r input exit_code=$? + +# Kill the background sleep process +kill $timeout_pid 2>/dev/null + cleaned_input=$(echo ${input} | sed "s/[^a-zA-Z0-9]//g") if [ ${exit_code} -eq 0 ] && [ "${cleaned_input}" = "PING" ];then