From d52a5075a838019c9163003817fd5b98b86ba709 Mon Sep 17 00:00:00 2001 From: c0dev0id Date: Thu, 5 Jan 2023 11:56:22 +0100 Subject: [PATCH] use actual cpu count --- scripts/mkphotos.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/mkphotos.sh b/scripts/mkphotos.sh index 4b26895..28befc9 100644 --- a/scripts/mkphotos.sh +++ b/scripts/mkphotos.sh @@ -4,6 +4,7 @@ DIR="$(basename "$PWD")" TITLE="$(basename "$PWD" |sed 's/unlisted-//g' | cut -d"_" -f2- | tr '-' ' ')" +PROCS="$(sysctl -n hw.ncpuonline)" mkdir -p thm mid @@ -70,7 +71,7 @@ do echo "" fi - while [ $(pgrep convert | wc -l) -ge 15 ] + while [ $(pgrep convert | wc -l) -gt $PROCS ] do sleep 0.3; done done