Skip to content

Commit

Permalink
Update install.sh: remove checks for null
Browse files Browse the repository at this point in the history
  • Loading branch information
EricClaeys authored Jul 18, 2023
1 parent e3d0586 commit d16081d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ get_desired_locale()
if [[ -z ${DESIRED_LOCALE} && -n ${PRIOR_ALLSKY} && -n ${PRIOR_SETTINGS_FILE} ]]; then
# People rarely change locale once set, so assume they still want the prior one.
DESIRED_LOCALE="$( settings .locale "${PRIOR_SETTINGS_FILE}" )"
if [[ -n ${DESIRED_LOCALE} && ${DESIRED_LOCALE} != "null" ]]; then
if [[ -n ${DESIRED_LOCALE} ]]; then
local X="$(echo "${INSTALLED_LOCALES}" | grep "${DESIRED_LOCALE}")"
if [[ -z ${X} ]]; then
# This is probably EXTREMELY rare.
Expand All @@ -1181,7 +1181,7 @@ get_desired_locale()
display_msg --logonly info "${MSG}"

local D=""
if [[ -n ${CURRENT_LOCALE} && ${CURRENT_LOCALE} != "null" ]]; then
if [[ -n ${CURRENT_LOCALE} ]]; then
D="--default-item ${CURRENT_LOCALE}"
else
CURRENT_LOCALE=""
Expand Down Expand Up @@ -1247,7 +1247,7 @@ set_locale()
display_msg --log progress "Keeping '${DESIRED_LOCALE}' locale."
local L="$( settings .locale )"
MSG="Settings file '${SETTINGS_FILE}'"
if [[ ${L} == "" || ${L} == "null" ]]; then
if [[ -z ${L} ]]; then
# Either a new install or an upgrade from an older Allsky.
MSG="${MSG} did NOT contain .locale so adding it."
display_msg --logonly info "${MSG}"
Expand Down Expand Up @@ -1570,22 +1570,22 @@ convert_settings() # prior_version, new_version, prior_file, new_file
# if they don't already exist.
local F="meanthreshold"
MEANTHRESHOLD="$( settings ".${F}" "${PRIOR_FILE}" )"
if [[ -n ${MEANTHRESHOLD} && ${MEANTHRESHOLD} != "null" ]]; then
if [[ -n ${MEANTHRESHOLD} ]]; then

DAYMEANTHRESHOLD="$( settings ".day${F}" "${NEW_FILE}" )"
if [[ -z ${DAYMEANTHRESHOLD} || ${DAYMEANTHRESHOLD} == "null" ]]; then
if [[ -z ${DAYMEANTHRESHOLD} ]]; then
display_msg --logonly info " Updating 'day${F}' in '${NEW_FILE}'."
update_json_file ".day${F}" "${MEANTHRESHOLD}" "${NEW_FILE}"
fi
NIGHTMEANTHRESHOLD="$( settings ".night${F}" "${NEW_FILE}" )"
if [[ -z ${NIGHTMEANTHRESHOLD} || ${NIGHTMEANTHRESHOLD} == "null" ]]; then
if [[ -z ${NIGHTMEANTHRESHOLD} ]]; then
display_msg --logonly info " Updating 'night${F}' in '${NEW_FILE}'."
update_json_file ".night${F}" "${MEANTHRESHOLD}" "${NEW_FILE}"
fi

# If ${F} exists in the new file
MEANTHRESHOLD="$( settings ".${F}" "${NEW_FILE}" )"
if [[ -n ${MEANTHRESHOLD} && ${MEANTHRESHOLD} != "null" ]]; then
if [[ -n ${MEANTHRESHOLD} ]]; then
display_msg --logonly info " Deleting '${F}' from '${NEW_FILE}'."
sed -i "/\"${F}\"/d" "${NEW_FILE}"
fi
Expand Down Expand Up @@ -1978,7 +1978,7 @@ restore_prior_files()
local OLD="false"
local NEW_CONFIG_VERSION="$(settings .ConfigVersion "${REPO_WEBCONFIG_FILE}")"
local PRIOR_CONFIG_VERSION="$(settings .ConfigVersion "${ALLSKY_REMOTE_WEBSITE_CONFIGURATION_FILE}")"
if [[ ${PRIOR_CONFIG_VERSION} == "" || ${PRIOR_CONFIG_VERSION} == "null" ]]; then
if [[ -z ${PRIOR_CONFIG_VERSION} ]]; then
OLD="true" # Hmmm, it should have the version
MSG="Prior Website configuration file '${ALLSKY_REMOTE_WEBSITE_CONFIGURATION_FILE}'"
MSG="${MSG}\nis missing .ConfigVersion. It should be '${NEW_CONFIG_VERSION}'."
Expand Down

0 comments on commit d16081d

Please sign in to comment.