From 1daf58fcd2f4538ae9a91dece8274fe6d412ab20 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 13 May 2018 12:39:07 +0100 Subject: [PATCH] Report tor status as starting if uptime is small --- src/freedombone-tor-health | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/freedombone-tor-health b/src/freedombone-tor-health index e7dc427e..f96a83b5 100755 --- a/src/freedombone-tor-health +++ b/src/freedombone-tor-health @@ -48,14 +48,22 @@ done < /var/log/tor/notices.log mv /var/log/tor/notices_new.log /var/log/tor/notices.log chown -R debian-tor:adm /var/log/tor -if [ $ctr -gt 5 ]; then - echo $'Failed' - exit 0 -fi +UPTIME=$(awk -F '.' '{print $1}' < "/proc/uptime") +if [ "$UPTIME" -gt 500 ]; then + if [ $ctr -gt 5 ]; then + echo $'Failed' + exit 0 + fi -if [ $ctr -gt 0 ]; then - echo $'Poor' - exit 0 + if [ $ctr -gt 0 ]; then + echo $'Poor' + exit 0 + fi +else + if [ $ctr -gt 0 ]; then + echo $'Starting' + exit 0 + fi fi echo $'Good'