Compare commits
3 commits
eb02287940
...
5d34acde46
Author | SHA1 | Date | |
---|---|---|---|
|
5d34acde46 | ||
|
15d48f3d55 | ||
|
91958cf969 |
3 changed files with 16 additions and 7 deletions
|
@ -20,6 +20,3 @@ matrix:
|
|||
ALPINE_VERSION:
|
||||
- "3.18.0"
|
||||
- "3.17.3"
|
||||
- "3.16.5"
|
||||
- "3.15.8"
|
||||
- "3.14.10"
|
||||
|
|
19
backup.sh
19
backup.sh
|
@ -6,14 +6,25 @@ test -n "${BORG_PASSPHRASE}"
|
|||
test -n "${DEST}"
|
||||
test -n "${SSH_ALIAS}"
|
||||
|
||||
# Defaults
|
||||
SSH_PORT="${SSH_PORT:-22}"
|
||||
SSH_SERVER="${SSH_SERVER:-${SSH_ALIAS}}"
|
||||
SSH_USER="${SSH_USER:-root}"
|
||||
|
||||
umask 077
|
||||
|
||||
DATE="$(date +%F)"
|
||||
ORIG=/srv/data
|
||||
|
||||
if ! grep -q "${SSH_ALIAS}" /root/.ssh/config ; then
|
||||
echo "Host ${SSH_ALIAS}" >> /root/.ssh/config
|
||||
echo " Port ${SSH_PORT:-22}" >> /root/.ssh/config
|
||||
echo " HostName ${SSH_SERVER:-${SSH_ALIAS}}" >> /root/.ssh/config
|
||||
echo " User ${SSH_USER:-root}" >> /root/.ssh/config
|
||||
echo "Host ${SSH_ALIAS}" >> /root/.ssh/config
|
||||
echo " Port ${SSH_PORT}" >> /root/.ssh/config
|
||||
echo " HostName ${SSH_SERVER}" >> /root/.ssh/config
|
||||
echo " User ${SSH_USER}" >> /root/.ssh/config
|
||||
fi
|
||||
|
||||
if ! ssh-keygen -F "[${SSH_SERVER}]:${SSH_PORT}"; then
|
||||
echo "${SSH_KNOWN_HOSTS}" >> /root/.ssh/known_hosts
|
||||
fi
|
||||
|
||||
ssh -fN ${SSH_ALIAS}
|
||||
|
|
|
@ -5,3 +5,4 @@ Host *
|
|||
VerifyHostKeyDNS yes
|
||||
HashKnownHosts yes
|
||||
StrictHostKeyChecking ask
|
||||
ForwardAgent yes
|
||||
|
|
Loading…
Reference in a new issue