Browse Source

new: [vps] updated final command to run after installation of backup

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
rc1
Valentin Lab 4 years ago
parent
commit
39ada47501
  1. 32
      bin/vps

32
bin/vps

@ -230,11 +230,18 @@ mailcow:install-backup() {
dest="$BACKUP_SERVER" dest="$BACKUP_SERVER"
dest="${dest%/*}" dest="${dest%/*}"
ssh_options=()
if [[ "$dest" == *":"* ]]; then
port="${dest##*:}"
dest="${dest%%:*}" dest="${dest%%:*}"
ssh_options=(-p "$port")
else
port=""
dest="${dest%%:*}"
fi
info "You should add key on '$dest' host:"
echo compose-add-rsync-key -R "\"$DOMAIN\"" "\"$(cat /var/lib/rsync/.ssh/id_rsa.pub)\""
info "You can run this following from an host having admin access to $dest:"
echo "ssh ${ssh_options[@]} rsync@$dest ssh-key add \"$(cat /var/lib/rsync/.ssh/id_rsa.pub)\""
} }
compose:install-backup() { compose:install-backup() {
@ -302,10 +309,23 @@ $(e "$private_key" | sed -r 's/^/ /g')
EOF EOF
fi fi
info "You can run this following command on $BACKUP_SERVER:"
public_key=$(ssh-keygen -y -f <(e "$private_key"$'\n'))
echo "compose-add-rsync-key -R '$host' '$public_key ${service_name}@$host'"
dest="$BACKUP_SERVER"
dest="${dest%/*}"
ssh_options=()
ssh_options=()
if [[ "$dest" == *":"* ]]; then
port="${dest##*:}"
dest="${dest%%:*}"
ssh_options=(-p "$port")
else
port=""
dest="${dest%%:*}"
fi
info "You can run this following from an host having admin access to $dest:"
public_key=$(ssh-keygen -y -f <(e "$private_key"$'\n'))
echo "ssh ${ssh_options[@]} rsync@$dest ssh-key add '$public_key ${service_name}@$host'"
} }

Loading…
Cancel
Save