Skip to content

Commit

Permalink
Update allsky.sh: rename settings passed to capture_*
Browse files Browse the repository at this point in the history
And only pass settings that begin with "_".
  • Loading branch information
EricClaeys authored Sep 18, 2023
1 parent 18a63bb commit eb8289b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions allsky.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ if [[ -f ${POST_INSTALLATION_ACTIONS} ]]; then
fi
fi

USE_NOTIFICATION_IMAGES="$( settings ".notificationimages" )" || exit "${ALLSKY_ERROR_STOP}"
USE_NOTIFICATION_IMAGES="$( settings "._notificationimages" )" || exit "${ALLSKY_ERROR_STOP}"
UHUBCTL_PATH="$( settings ".uhubctlpath" )" || exit "${ALLSKY_ERROR_STOP}"
UHUBCTL_PORT="$( settings ".uhubctlport" )" || exit "${ALLSKY_ERROR_STOP}"
LOCALE="$( settings .locale )" || exit "${ALLSKY_ERROR_STOP}"
LOCALE="$( settings "._locale" )" || exit "${ALLSKY_ERROR_STOP}"

if [[ -z ${CAMERA_TYPE} ]]; then
MSG="FATAL ERROR: 'Camera Type' not set in WebUI."
Expand Down Expand Up @@ -240,17 +240,18 @@ fi

# We must pass "-config ${ARGS_FILE}" on the command line,
# and debuglevel we did above, so don't do them again.
# Only pass settings whose names begin with "_". Other ones aren't use by capture*.
TAB="$( echo -e "\t" )"
convert_json_to_tabs "${SETTINGS_FILE}" |
grep -E -i -v "^config${TAB}|^debuglevel${TAB}" |
grep -E -i -v "^_|^_config${TAB}|^_debuglevel${TAB}" |
sed -e 's/^/-/' -e "s/${TAB}/=/" >> "${ARGS_FILE}"

# When using a desktop environment a preview of the capture can be displayed in a separate window.
# The preview mode does not work if we are started as a service or if the debian distribution has no desktop environment.
[[ $1 == "preview" ]] && echo "-preview=true" >> "${ARGS_FILE}"
[[ $1 == "preview" ]] && echo "-_preview=true" >> "${ARGS_FILE}"

echo "-version=$( get_version )" >> "${ARGS_FILE}"
echo "-save_dir=${CAPTURE_SAVE_DIR}" >> "${ARGS_FILE}"
echo "-_version=$( get_version )" >> "${ARGS_FILE}"
echo "-_save_dir=${CAPTURE_SAVE_DIR}" >> "${ARGS_FILE}"

FREQUENCY_FILE="${ALLSKY_TMP}/IMG_UPLOAD_FREQUENCY.txt"
# If the user wants images uploaded only every n times, save that number to a file.
Expand Down

0 comments on commit eb8289b

Please sign in to comment.