Fixed config is being generated even though it should be skipped

This commit is contained in:
Enrico Ludwig 2024-05-24 12:44:52 +02:00
parent 792b0922dd
commit df7106a956

View File

@ -69,7 +69,7 @@ SKIP_CONFIG=0 # Set to 1 to skip the borgmatic configuration
readonly SCRIPT_NAME="Borgmatic Backup Setup Tool"
readonly SCRIPT_AUTHOR="Zion Networks at admin@zion-networks.de"
readonly SCRIPT_SUPPORT="admin@zion-networks.de"
readonly VERSION="1.2.2"
readonly VERSION="1.2.3"
# logging functions
function inf {
@ -915,6 +915,8 @@ elif [ -f $BORGMATIC_CONFIG_FILE ] && [ $OVERRIDE_CONFIG -eq 1 ]; then
wrn "Existing borgmatic configuration file will be overridden!"
fi
if [ $SKIP_CONFIG -eq 0 ]; then
cat > $BORGMATIC_CONFIG_FILE <<EOF
ssh_command: ssh -i $SSH_KEY_FILE -p $SSH_PORT
@ -945,6 +947,7 @@ else
err "If the error persists, please contact the support at $SCRIPT_SUPPORT."
exit 1
fi
fi
if ! inf_follow "Validating borgmatic configuration..." "\e[1;32mOK\e[0m" "\e[1;31mFAILED\e[0m" run_command /root/.local/pipx/venvs/borgmatic/bin/borgmatic config validate; then
err "Validation of borgmatic configuration failed."