Skip to content

Commit

Permalink
Update makeChanges.sh: only update map if we're using it
Browse files Browse the repository at this point in the history
  • Loading branch information
EricClaeys authored Jul 29, 2023
1 parent e2d2b34 commit 37eac36
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions scripts/makeChanges.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ SHOW_POSTDATA_MESSAGE="true"
TWILIGHT_DATA_CHANGED="false"
CAMERA_TYPE_CHANGED="false"
GOT_WARNING="false"
SHOW_ON_MAP=""

# Several of the fields are in the Allsky Website configuration file,
# so check if the IS a file before trying to update it.
Expand Down Expand Up @@ -139,7 +140,8 @@ check_website # invoke to set variables

CAMERA_NUMBER=""

while [[ $# -gt 0 ]]; do
while [[ $# -gt 0 ]]
do
KEY="${1}"
LABEL="${2}"
OLD_VALUE="${3}"
Expand Down Expand Up @@ -237,7 +239,7 @@ while [[ $# -gt 0 ]]; do
# Create a link to a file that contains the camera type and model in the name.
CAMERA_TYPE="${NEW_VALUE}" # already know it
CAMERA_MODEL="$( settings .cameraModel "${CC_FILE}" )"
if [[ -z ${CAMERA_MODEL} || ${CAMERA_MODEL} == "null" ]]; then
if [[ -z ${CAMERA_MODEL} ]]; then
echo -e "${wERROR}ERROR: 'cameraModel' not found in ${CC_FILE}.${wNC}"
[[ -f ${CC_FILE_OLD} ]] && mv "${CC_FILE_OLD}" "${CC_FILE}"
exit 1
Expand Down Expand Up @@ -440,6 +442,7 @@ while [[ $# -gt 0 ]]; do
;;

showonmap)
SHOW_ON_MAP="${NEW_VALUE}"
[[ ${NEW_VALUE} -eq 0 ]] && POSTTOMAP_ACTION="--delete"
RUN_POSTTOMAP="true"
;;
Expand Down Expand Up @@ -534,9 +537,12 @@ if [[ ${#WEBSITE_CONFIG[@]} -gt 0 ]]; then
fi

if [[ ${RUN_POSTTOMAP} == "true" ]]; then
[[ ${DEBUG} == "true" ]] && echo -e "${wDEBUG}Executing postToMap.sh${NC}"
# shellcheck disable=SC2086
"${ALLSKY_SCRIPTS}/postToMap.sh" --whisper --force ${DEBUG_ARG} ${POSTTOMAP_ACTION}
[[ -z ${SHOW_ON_MAP} ]] && SHOW_ON_MAP="$( settings ".showonmap" )"
if [[ ${SHOW_ON_MAP} == "1" ]]; then
[[ ${DEBUG} == "true" ]] && echo -e "${wDEBUG}Executing postToMap.sh${NC}"
# shellcheck disable=SC2086
"${ALLSKY_SCRIPTS}/postToMap.sh" --whisper --force ${DEBUG_ARG} ${POSTTOMAP_ACTION}
fi
fi

if [[ ${RESTARTING} == "false" && ${NEEDS_RESTART} == "true" ]]; then
Expand Down

0 comments on commit 37eac36

Please sign in to comment.