Skip to content

Commit

Permalink
Update postToMap.sh: send error message to log
Browse files Browse the repository at this point in the history
  • Loading branch information
EricClaeys authored Nov 24, 2024
1 parent 569aefc commit 70c7f7e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/postToMap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ if [[ ${UPLOAD} == "true" ]]; then
# shellcheck disable=SC2089
CMD="curl -i -H 'Accept: application/json' -H 'Content-Type:application/json'"
# shellcheck disable=SC2089
CMD+=" --data '$( generate_post_data )' 'https://www.thomasjacquin.com/allsky-map/postToMap.php'"
CMD+=" --data '$( generate_post_data )'"
CMD+=" 'https://www.thomasjacquin.com/allsky-map/postToMap.php'"
[[ ${DEBUG} == "true" ]] && echo -e "\n${wDEBUG}Executing:\n${CMD}${wNC}\n"

# shellcheck disable=SC2090,SC2086
Expand All @@ -345,8 +346,12 @@ if [[ ${UPLOAD} == "true" ]]; then
[[ ${DEBUG} == "true" ]] && echo -e "\n${wDEBUG}Returned:\n${RETURN}${wNC}.\n"
if [[ ${RETURN_CODE} -ne 0 ]]; then
E="ERROR while uploading map data with curl: ${RETURN}, CMD=${CMD}."
echo -e "${ERROR_MSG_START}${E}${wNC}"
[[ ${ENDOFNIGHT} == "true" ]] && "${ALLSKY_SCRIPTS}/addMessage.sh" "error" "${ME}: ${E}"
if [[ ${ENDOFNIGHT} == "true" ]]; then
echo -e "${ME}: ${E}" # goes in log file
"${ALLSKY_SCRIPTS}/addMessage.sh" "error" "${ME}: ${E}"
else
echo -e "${ERROR_MSG_START}${E}${wNC}"
fi
exit ${RETURN_CODE}
fi

Expand Down

0 comments on commit 70c7f7e

Please sign in to comment.