feature(BACKUP): add SSH port customization

- borgSSHPort variable in details file
- read and appended to RSH connection string
- default to standard port 22

Closes github #9
This commit is contained in:
Asif Bacchus 2021-03-08 00:08:22 -07:00
parent de76918e81
commit 5ea25529b9
2 changed files with 16 additions and 4 deletions

View File

@ -20,6 +20,9 @@
# default is "$HOME" or "~$USER" in that order. If you're unsure, try "$HOME"
borgBaseDir = "/var/borgbackup"
# SSH port on which your borg server listens. By default, this is port 22.
borgSSHPort = 22
# full path to the SSH key used to connect to your remote backup server
borgSSHKey = "/var/borgbackup/private.key"

View File

@ -529,7 +529,16 @@ elif [ ! -f "${borgSSHKey}" ]; then
fi
printf "%sdetails:borgSSHKey %s-- %s[OK]%s\n" \
"$magenta" "$norm" "$ok" "$norm" >> "$logFile"
export BORG_RSH="ssh -i ${borgSSHKey}"
## check SSH port
if [ -z "${borgSSHPort}" ]; then
borgSSHPort=22
printf "%sdetails:borgSSHPort %s-- %s[DEFAULT]%s\n" \
"$magenta" "$norm" "$ok" "$norm" >> "$logFile"
else
printf "%sdetails:borgSSHPort %s-- %s[CUSTOM]%s\n" \
"$magenta" "$norm" "$ok" "$norm" >> "$logFile"
fi
export BORG_RSH="ssh -i ${borgSSHKey} -p ${borgSSHPort}"
## check borg repo connect string
if [ -z "${borgConnectRepo}" ]; then