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 3 years ago
parent
commit
39ada47501
  1. 34
      bin/vps

34
bin/vps

@ -230,11 +230,18 @@ mailcow:install-backup() {
dest="$BACKUP_SERVER"
dest="${dest%/*}"
dest="${dest%%:*}"
info "You should add key on '$dest' host:"
echo compose-add-rsync-key -R "\"$DOMAIN\"" "\"$(cat /var/lib/rsync/.ssh/id_rsa.pub)\""
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:"
echo "ssh ${ssh_options[@]} rsync@$dest ssh-key add \"$(cat /var/lib/rsync/.ssh/id_rsa.pub)\""
}
compose:install-backup() {
@ -302,10 +309,23 @@ $(e "$private_key" | sed -r 's/^/ /g')
EOF
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