I poll a string from an app API that matches with true
or false
to take further actions.
until curl.../connections|awk -v LID=$LinkID '$0~LID,/}/ {if ($0~/connected/) print}'|grep -q 'connected true,'; do
sleep 5
done
if other condition; then exit 0
fi
while other statement; do
sleep 15
done
shutdown
fi
My problem is that the false
value is not reliable from a single poll on the long run in certain circumstances, which leads to a premature done
. I'd need the expression between until
and do
to be re-checked, say 5s after the first one, but I don't know how to this.
Please help
[EDIT] : not sure the title of the thread is well worded