From 63b841a38586edc306bf9d7eb7af64095d33e00d Mon Sep 17 00:00:00 2001 From: "sh+git@codevoid.de" Date: Sun, 27 Oct 2019 18:32:35 +0000 Subject: [PATCH] Fix process counting... --- mkpicindex-static.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkpicindex-static.sh b/mkpicindex-static.sh index b5be967..f12b6c8 100755 --- a/mkpicindex-static.sh +++ b/mkpicindex-static.sh @@ -85,8 +85,8 @@ get_width_by_height() { } # TOO MANY CONVERT PROCSSES => WAIT thread_check() { - while [ $(pgrep convert | wc -l | awk '{ print $1 }') -gt $THREADS ]; - do console "More than $THREADS convert threads. Waiting..."; sleep 2; done + while [ $(pgrep convert | wc -l | awk '{ print $1 }') -gt $(($THREADS-1)) ]; + do console "Process Limit ($THREADS) reached. Waiting..."; sleep 2; done } # CREATE THUMBNAIL