add xargs to properly check for empty activeChildren string

This commit is contained in:
Iris Lightshard 2019-12-30 12:38:25 -05:00
parent 5ae3818ed8
commit 32943a97ba
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398

View file

@ -46,6 +46,10 @@ while true; do
for child in ${children}; do
activeChildren="${activeChildren} $(ps T | grep $child | awk '{print $1}')"
done
# if no active children, trim the whitespace so we can check for empty string
activeChildren=$(echo ${activeChildren} | xargs echo)
if [ -z "${activeChildren}" ]; then
break
else