Skip to content

Commit

Permalink
reduce error noise
Browse files Browse the repository at this point in the history
  • Loading branch information
kx1t committed Jun 1, 2024
1 parent 29b8f7c commit caf8db3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion rootfs/etc/s6-overlay/scripts/cleanup
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ do
GET_ICAO_DB
GET_AIRLINE_DB
if [[ -n "$MASTODON_SERVER$MASTODON_ACCESS_TOKEN" ]]; then
/scripts/masto_expire.sh delete
/scripts/masto_expire.sh delete || true
fi
[[ "${LOGLEVEL,,}" != "error" ]] && "${s6wrap[@]}" echo "Cleanup done. Sleeping for $LOOPTIME" || true
sleep $LOOPTIME
Expand Down
19 changes: 11 additions & 8 deletions rootfs/usr/share/planefence/planefence.sh
Original file line number Diff line number Diff line change
Expand Up @@ -529,14 +529,17 @@ EOF
# right below. Right now, it lists all files that have the planefence-20*.html format (planefence-200504.html, etc.), and then
# picks the newest 7 (or whatever HISTTIME is set to), reverses the strings to capture the characters 6-11 from the right, which contain the date (200504)
# and reverses the results back so we get only a list of dates in the format yymmdd.
# shellcheck disable=SC2012
for d in $(ls -1 "$1"/planefence-??????.html | tail --lines=$((HISTTIME+1)) | head --lines="$HISTTIME" | rev | cut -c6-11 | rev | sort -r)
do
{ printf " | %s" "$(date -d "$d" +%d-%b-%Y): "
printf "<a href=\"%s\" target=\"_top\">html</a> - " "planefence-$(date -d "$d" +"%y%m%d").html"
printf "<a href=\"%s\" target=\"_top\">csv</a>" "planefence-$(date -d "$d" +"%y%m%d").csv"
} >> "$2"
done

if compgen -G "$1/planefence-??????.html" >/dev/null; then
# shellcheck disable=SC2012
for d in $(ls -1 "$1"/planefence-??????.html | tail --lines=$((HISTTIME+1)) | head --lines="$HISTTIME" | rev | cut -c6-11 | rev | sort -r)
do
{ printf " | %s" "$(date -d "$d" +%d-%b-%Y): "
printf "<a href=\"%s\" target=\"_top\">html</a> - " "planefence-$(date -d "$d" +"%y%m%d").html"
printf "<a href=\"%s\" target=\"_top\">csv</a>" "planefence-$(date -d "$d" +"%y%m%d").csv"
} >> "$2"
done
fi
{ printf "</p>\n"
printf "<p>Additional dates may be available by browsing to planefence-yymmdd.html in this directory.</p>"
printf "</details>\n</article>\n</section>"
Expand Down
2 changes: 1 addition & 1 deletion rootfs/usr/share/planefence/prep-planefence.sh
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ fi
[[ -n "$PF_MAPZOOM" ]] && sed -i 's|\(^\s*HEATMAPZOOM=\).*|\1'"\"$PF_MAPZOOM\""'|' /usr/share/planefence/planefence.conf
#
# Also do this for files in the past -- /usr/share/planefence/html/planefence-??????.html
if find /usr/share/planefence/html/planefence-??????.html >/dev/null 2>&1; then
if compgen -G "$1/planefence-??????.html" >/dev/null; then
for i in /usr/share/planefence/html/planefence-??????.html; do
[[ -n "$PF_MAPWIDTH" ]] && sed -i 's|\(^\s*<div id=\"map\" style=\"width:.*;\)|<div id=\"map\" style=\"width:'"$PF_MAPWIDTH"';|' "$i"
[[ -n "$PF_MAPHEIGHT" ]] && sed -i 's|\(; height:[^\"]*\)|; height: '"$PF_MAPHEIGHT"'\"|' "$i"
Expand Down

0 comments on commit caf8db3

Please sign in to comment.