From 81e5ab7ab21b5f5bd2648348b92fc6fca8b83c03 Mon Sep 17 00:00:00 2001 From: Fred Clausen <43556888+fredclausen@users.noreply.github.com> Date: Sat, 30 Sep 2023 13:02:50 -0600 Subject: [PATCH] shut up the logs --- rootfs/usr/bin/adsbhub.sh | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/rootfs/usr/bin/adsbhub.sh b/rootfs/usr/bin/adsbhub.sh index 1604109..f10149a 100755 --- a/rootfs/usr/bin/adsbhub.sh +++ b/rootfs/usr/bin/adsbhub.sh @@ -12,6 +12,8 @@ myip4="0.0.0.0" myip6="::" cmin=0 +shouldprint=1 + while true; do # Check connection and reconnect @@ -23,11 +25,22 @@ while true; do result="connected" else result="not connected" + shouldprint=1 eval "${cmd}" & fi - echo "$result" - + if [ "$result" == "connected" ] + then + if [ $shouldprint -eq 1 ] + then + shouldprint=0 + echo "$result" + echo "Will not print this message again unless connection is lost" + fi + else + shouldprint=1 + echo "$result" + fi # Update IP if change if [ -n "$ckey" ] @@ -57,11 +70,11 @@ while true; do myip6=$currentip6 echo "$result" fi - fi - fi + fi + fi fi fi sleep 60 - + done