Skip to content

Commit

Permalink
make clear when the cached version is used
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedehopf committed Apr 18, 2024
1 parent 414f866 commit 23533bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rootfs/etc/s6-overlay/startup.d/06-range-outline
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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}"
Expand Down

0 comments on commit 23533bb

Please sign in to comment.