diff --git a/rootfs/etc/s6-overlay/scripts/cleanup b/rootfs/etc/s6-overlay/scripts/cleanup index 8b069dc..7897de1 100755 --- a/rootfs/etc/s6-overlay/scripts/cleanup +++ b/rootfs/etc/s6-overlay/scripts/cleanup @@ -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 diff --git a/rootfs/usr/share/planefence/planefence.sh b/rootfs/usr/share/planefence/planefence.sh index 02737b6..969c725 100755 --- a/rootfs/usr/share/planefence/planefence.sh +++ b/rootfs/usr/share/planefence/planefence.sh @@ -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 "html - " "planefence-$(date -d "$d" +"%y%m%d").html" - printf "csv" "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 "html - " "planefence-$(date -d "$d" +"%y%m%d").html" + printf "csv" "planefence-$(date -d "$d" +"%y%m%d").csv" + } >> "$2" + done + fi { printf "
\n" printf "Additional dates may be available by browsing to planefence-yymmdd.html in this directory.
" printf "\n\n" diff --git a/rootfs/usr/share/planefence/prep-planefence.sh b/rootfs/usr/share/planefence/prep-planefence.sh index 83a4f60..72af18e 100755 --- a/rootfs/usr/share/planefence/prep-planefence.sh +++ b/rootfs/usr/share/planefence/prep-planefence.sh @@ -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*