#985 fix background monitoring

This commit is contained in:
rootzoll 2020-01-25 23:52:57 +01:00
parent f33af14951
commit 55111c37c2

View File

@ -161,17 +161,17 @@ do
# check every 30sec
recheckBlitzTUI=$(($counter % 30))
if [ ${recheckBlitzTUI} -eq 1 ]; then
echo "BlitzTUI Monitoring ..."
if [ "${touchscreen}" == "1" ] && [ ${recheckBlitzTUI} -eq 1 ]; then
echo "BlitzTUI Monitoring Check"
latestHeartBeatLine=$(sudo tail -n 300 /home/pi/blitz-tui.log | grep beat | tail -n 1)
if [ ${#blitzTUIHeartBeatLine} -gt 0 ]; then
echo "blitzTUIHeartBeatLine(${blitzTUIHeartBeatLine})"
echo "latestHeartBeatLine(${latestHeartBeatLine})"
#echo "blitzTUIHeartBeatLine(${blitzTUIHeartBeatLine})"
#echo "latestHeartBeatLine(${latestHeartBeatLine})"
if [ "${blitzTUIHeartBeatLine}" == "${latestHeartBeatLine}" ]; then
echo "FAIL - still no new heart beat .. restarting BlitzTUI"
sudo init 3 ; sleep 2 ; sudo init 5
else
echo "OK - Beat changes since last period - BlitzTUI is alive"
# echo "OK - Beat changes since last period - BlitzTUI is alive"
fi
else
echo "blitzTUIHeartBeatLine is empty - skipping check"