Skip to content

Commit

Permalink
minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
kx1t committed Oct 23, 2023
1 parent 6836ea1 commit 05d1ea3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rootfs/etc/s6-overlay/scripts/radar1090
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ RADAR_CMD+=("-k ${RADAR1090_KEY}")
RADAR_CMD+=("-h ${RADARSERVER:-adsb-in.1090mhz.uk}")
RADAR_CMD+=("-p ${RADARPORT:-2227}")
RADAR_CMD+=("-l ${beast_host}")
chk_enabled "$VERBOSE" && RADAR_CMD+=("-s") || true
RADAR_CMD+=("-s")

"${s6wrap[@]}" --args echo "invoking: ${RADAR_BIN[@]} ${RADAR_CMD[@]}"
${RADAR_BIN[@]} ${RADAR_CMD[@]} > /var/log/radar1090
${RADAR_BIN[@]} ${RADAR_CMD[@]} >> /var/logs/radar1090
3 changes: 2 additions & 1 deletion rootfs/etc/s6-overlay/scripts/radar1090-log
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ RANDOM=$(date +%s)
sleep $((RANDOM/1000))

# Now go at it furreal:
touch "$LOGFILE"
while true; do
# First wait to collect some data. This data is written by the radar1090 binary to /var/logs/radar1090:
sleep "$WAITTIME"
# read the last lines into an array:
readarray -t loglines <<< "$(tail -"$WAITTIME" "$LOGFILE")"
# Immediately clear logs:
logrotate -f /etc/default/logrotate.conf

# Now parse some statistics:
packets=("$(awk '{ print $3 }' <<< "$(printf "%s\n" "${loglines[@]}")")")
dupes=("$(awk '{ print $7 }' <<< "$(printf "%s\n" "${loglines[@]}")")")
Expand Down

0 comments on commit 05d1ea3

Please sign in to comment.