From 23533bbaa6394a34cc2666c4c75026125fe9a940 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Thu, 18 Apr 2024 21:59:30 +0200 Subject: [PATCH] make clear when the cached version is used --- rootfs/etc/s6-overlay/startup.d/06-range-outline | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rootfs/etc/s6-overlay/startup.d/06-range-outline b/rootfs/etc/s6-overlay/startup.d/06-range-outline index 1c6f498..a919a8b 100755 --- a/rootfs/etc/s6-overlay/startup.d/06-range-outline +++ b/rootfs/etc/s6-overlay/startup.d/06-range-outline @@ -34,8 +34,6 @@ if [ -n "${HEYWHATSTHAT_PANORAMA_ID}" ]; then printf -v HEYWHATSTHAT_ALTS -- "%s," "${alts_array[@]}" HEYWHATSTHAT_ALTS="${HEYWHATSTHAT_ALTS:0:-1}" - echo "Getting HeyWhatsThat Range Outlines for these altitudes (in meters): ${HEYWHATSTHAT_ALTS}" - HEY_URL="http://www.heywhatsthat.com/api/upintheair.json?id=${HEYWHATSTHAT_PANORAMA_ID}&refraction=0.25&alts=${HEYWHATSTHAT_ALTS:-12192}" OFILE="${TAR1090_INSTALL_DIR}/html-webroot/upintheair.json" @@ -45,8 +43,10 @@ if [ -n "${HEYWHATSTHAT_PANORAMA_ID}" ]; then if [[ -f "${PFILE}" ]] && diff -q "$URL_FILE" <(cat <<<"${HEY_URL}") &>/dev/null; then # url identical, use old file + echo "Using cached HeyWhatsThat Range Outlines for these altitudes (in meters): ${HEYWHATSTHAT_ALTS}" cp -f "${PFILE}" "${OFILE}" else + echo "Getting HeyWhatsThat Range Outlines for these altitudes (in meters): ${HEYWHATSTHAT_ALTS}" if curl --silent --show-error --output "${OFILE}" "${HEY_URL}"; then cp -f "${OFILE}" "${PFILE}" cat <<<"${HEY_URL}" >"${URL_FILE}"