Skip to content

Commit

Permalink
Moved config update message and added some comments to clarify config…
Browse files Browse the repository at this point in the history
… update process
  • Loading branch information
framps committed Nov 25, 2024
1 parent de45bde commit 65a0e5f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions raspiBackup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8992,7 +8992,7 @@ function updateConfig() {
return
fi

logItem "Current config version: $etcConfigFileVersion - Required config version: $VERSION_SCRIPT_CONFIG"
logItem "Current config version: $etcConfigFileVersion - Required config version: $VERSION_SCRIPT_CONFIG" # VERSION_SCRIPT_CONFIG is from updated script

if (( $(compareVersions "$etcConfigFileVersion" "$VERSION_SCRIPT_CONFIG") >= 0 )) ; then # ETC_CONFIG >= SCRIPT_CONFIG
logExit "Config version ok"
Expand All @@ -9003,8 +9003,6 @@ function updateConfig() {
return
fi

writeToConsole $MSG_LEVEL_MINIMAL $MSG_CURRENT_CONFIGURATION_UPDATE_REQUIRED "$etcConfigFileVersion" "$VERSION_SCRIPT_CONFIG"

if grep -iqE "alpha|beta" <<< "$VERSION"; then
eval "DL_URL=$BETA_CONFIG_URL"
else
Expand Down Expand Up @@ -9034,16 +9032,17 @@ function updateConfig() {

logItem "New config version of downloaded file: $newConfigVersion"

if (( $(compareVersions "$etcConfigFileVersion" "$VERSION_SCRIPT_CONFIG") < 0 )); then # ETC_CONFIG_FILE_VERSION < SCRIPT_CONFIG
logItem "Config update version in script: $VERSION_SCRIPT_CONFIG - Current config version : $etcConfigFileVersion"

if (( $(compareVersions "$newConfigVersion" "$VERSION_SCRIPT_CONFIG") < 0 )); then # newConfigVersion < SCRIPT_CONFIG
logItem "No config update possible: $VERSION_SCRIPT_CONFIG - Available: $newConfigVersion"
# Should not occure but make sure config is not downgraded for some reasons
if (( $(compareVersions "$newConfigVersion" "$VERSION_SCRIPT_CONFIG") < 0 )); then # newConfigVersion < SCRIPT_CONFIG
if (( $UPDATE_CONFIG )); then
writeToConsole $MSG_LEVEL_MINIMAL $MSG_NO_CONFIGUPDATE_REQUIRED "$VERSION_SCRIPT_CONFIG"
logExit
return
fi
fi

writeToConsole $MSG_LEVEL_MINIMAL $MSG_CURRENT_CONFIGURATION_UPDATE_REQUIRED "$etcConfigFileVersion" "$VERSION_SCRIPT_CONFIG"

rm -f $MERGED_CONFIG &>/dev/null

# process NEW CONFIG FILE
Expand Down

0 comments on commit 65a0e5f

Please sign in to comment.