Skip to content

Commit

Permalink
create sentinel file, stop timeout from printing errors to console
Browse files Browse the repository at this point in the history
  • Loading branch information
fredclausen committed Dec 9, 2023
1 parent bee0895 commit 54af6ce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 6 additions & 2 deletions rootfs/etc/s6-overlay/scripts/dumphfdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

source /scripts/common

touch /run/hfdl_test_mode

if [[ -z "$TIMEOUT" ]]; then
TIMEOUT=90
fi
Expand Down Expand Up @@ -87,7 +89,7 @@ freq+=("21928 21931 21934 21937 21949 21955 21982 21990 21995 21997")
# build the command line for dumphfdl
dumpcmd=( /usr/local/bin/dumphfdl )

# edit the soapysdr driver as reuired
# edit the soapysdr driver as required
dumpcmd+=( --soapysdr ${SOAPYSDRDRIVER} )
dumpcmd+=(--station-id "$FEED_ID")

Expand All @@ -96,7 +98,7 @@ dumpcmd+=( --output "decoded:text:file:path=$LOGFILE")
dumpcmd+=(--output "decoded:json:udp:address=127.0.0.1,port=5556")
dumpcmd+=(--output "decoded:json:tcp:address=feed.airframes.io,port=5556")

# adjust scoring weigths
# adjust scoring weights
WEIGHT_POSITIONS=40
WEIGHT_AIRCRAFT=10
WEIGHT_GROUNDSTATION=1
Expand Down Expand Up @@ -172,6 +174,8 @@ done
#NOTE: if something is wrong with your script or if no messages were received it will always default to using the first frequency array


rm -rf /run/hfdl_test_mode

longcmd=( "${dumpcmd[@]}" $GAIN_TYPE $GAIN --sample-rate $SOAPYSAMPLERATE ${freq[$k]} )

"${s6wrap[@]}" echo "------"
Expand Down
8 changes: 7 additions & 1 deletion rootfs/etc/s6-overlay/scripts/hfdl_stats
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#shellcheck shell=bash

#shellcheck disable=SC2154
source /scripts/common
s6wrap=(s6wrap --quiet --timestamps --prepend="$(basename "$0")" --args)

set -o pipefail

Expand All @@ -26,6 +26,12 @@ while true; do
exit
fi

# if /run/hfdl_test_mode exists we're in test mode, so don't do any of the following
if [[ -f /run/hfdl_test_mode ]]; then
rm -rf /run/hfdl/hfdl.*.json
continue
fi

# shellcheck disable=SC2016
"${s6wrap[@]}" echo "$(sed 's/}{/}\n{/g' /run/hfdl/hfdl.past5min.json | wc -l) hfdl messages received in last 5 mins"

Expand Down

0 comments on commit 54af6ce

Please sign in to comment.