diff options
-rw-r--r-- | shredder.sh | 4 |
1 files changed, 3 insertions, 1 deletions
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 |