summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Stevens <drkste@zoho.com>2020-01-15 12:39:52 -0500
committerDerek Stevens <drkste@zoho.com>2020-01-15 12:39:52 -0500
commitc193f910379598a780a10ef1fa1a0e05a712dd93 (patch)
treed856ce0e86ef2557cdf64b65a47c3fed12b43663
parent32943a97baeecbd1edfcf713f1511153b182fae7 (diff)
fix check for shred PIDs
-rw-r--r--shredder.sh4
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