From d16081dc93acc97604a3caad9ea098a400c5969e Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Mon, 17 Jul 2023 20:47:02 -0500 Subject: [PATCH] Update install.sh: remove checks for null --- install.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index e38959e63..a23a8af01 100755 --- a/install.sh +++ b/install.sh @@ -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. @@ -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="" @@ -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}" @@ -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 @@ -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}'."