Only call kill when there are background jobs

This commit is contained in:
2024-05-02 18:05:56 +02:00
parent 856e3d33f9
commit 9724ef1aa2

View File

@@ -18,7 +18,9 @@ cleanup() {
rm -rf "${tmpdir}"
pids=()
jobs -p | while IFS="" read -r line; do pids+=("$line"); done
if (( "${#pids[@]}" > 0)) ; then
kill "${pids[@]}"
fi
}
download_iso() {