From c193f910379598a780a10ef1fa1a0e05a712dd93 Mon Sep 17 00:00:00 2001 From: Derek Stevens Date: Wed, 15 Jan 2020 12:39:52 -0500 Subject: [PATCH] fix check for shred PIDs --- shredder.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shredder.sh b/shredder.sh index c321183..78ba718 100644 --- a/shredder.sh +++ b/shredder.sh @@ -44,7 +44,9 @@ done while true; do for child in ${children}; do - activeChildren="${activeChildren} $(ps T | grep $child | awk '{print $1}')" + if kill -0 ${child}; then + activeChildren="${activeChildren} ${child}" + fi done # if no active children, trim the whitespace so we can check for empty string