diff --git a/borgmatic_setup.sh b/borgmatic_setup.sh index 2faa0af..dd80365 100755 --- a/borgmatic_setup.sh +++ b/borgmatic_setup.sh @@ -35,7 +35,7 @@ DEBUG=0 # Set to 1 to enable debug mode BACKUP_REPO="Backups/$(hostname | tr '[:lower:]' '[:upper:]')" # Repository path on the backup server BACKUP_ENCRYPTION="none" # Encryption method for the backup repository (default: none) -BACKUP_PASSPHRASE="example" # Make sure to change this to a secure passphrase (will be ignored if encryption is set to none) +BACKUP_PASSPHRASE='example' # Make sure to change this to a secure passphrase (will be ignored if encryption is set to none) BACKUP_DIRS="/etc /var/log /home" # Directories to backup, separated by space BACKUP_LABEL_PREFIX="BACKUP-" # Prefix for the backup label BACKUP_CRON_SCHEDULE="0 3 * * *" # Cron schedule for backups (default: daily at 3:00 AM) @@ -45,7 +45,7 @@ BORGMATIC_CONFIG_FILE="/etc/borgmatic/config.yaml" # Path to the borgmatic confi SSH_HOST="127.0.0.1" # Hostname or IP address of the backup server SSH_PORT="22" # SSH port of the backup server (default: 22) SSH_USER="root" # SSH user on the backup server -SSH_PASSWORD="12345678" # Only required for copying the ssh key to the backup server +SSH_PASSWORD='12345678' # Only required for copying the ssh key to the backup server SSH_KEY_NAME="borgmatic" SSH_KEY_TYPE="ed25519" # SSH key type (e.g. rsa, dsa, ecdsa, ed25519), default: ed25519 SSH_KEY_FILE="/root/.ssh/${SSH_KEY_NAME}_${SSH_KEY_TYPE}" @@ -680,7 +680,7 @@ if [ -z "$SSH_PASSWORD" ]; then wrn "Please enter the password for the ssh key to copy it to the backup server." wrn "This is required to enable passwordless ssh login for backups." - read -s -p "Password: " SSH_PASSWORD + read -r -s -p "Password: " SSH_PASSWORD echo "" fi @@ -826,7 +826,7 @@ if [ -z "$BACKUP_PASSPHRASE" ] && [ "$BACKUP_ENCRYPTION" != "none" ]; then wrn "Please enter the passphrase for the backup encryption." wrn "This is required to encrypt your backups." - read -s -p "Passphrase: " BACKUP_PASSPHRASE + read -r -s -p "Passphrase: " BACKUP_PASSPHRASE echo "" fi @@ -837,7 +837,7 @@ if [ "$BACKUP_ENCRYPTION" == "none" ]; then exit 1 fi else - if ! inf_follow "Setting up borgmatic repository with encryption..." "\e[1;32mOK\e[0m" "\e[1;31mFAILED\e[0m" run_command BORG_PASSPHRASE=$BACKUP_PASSPHRASE /root/.local/pipx/venvs/borgmatic/bin/borgmatic init --make-parent-dirs --encryption=$BACKUP_ENCRYPTION; then + if ! inf_follow "Setting up borgmatic repository with encryption..." "\e[1;32mOK\e[0m" "\e[1;31mFAILED\e[0m" run_command BORG_PASSPHRASE="$BACKUP_PASSPHRASE" /root/.local/pipx/venvs/borgmatic/bin/borgmatic init --make-parent-dirs --encryption="$BACKUP_ENCRYPTION"; then err "Failed to set up borgmatic repository with encryption." err "If the error persists, please contact the support at $SCRIPT_SUPPORT." exit 1