Browse Source

fix: [vps] make `vps install backup` compatible with latest ``openssh-client``'s version.

pull/4/head
Valentin Lab 2 years ago
parent
commit
028ada295d
  1. 2
      bin/0km
  2. 5
      bin/vps

2
bin/0km

@ -746,7 +746,7 @@ vps_install_backup() {
key="${out%\'*}" key="${out%\'*}"
key="${key##*\'}" key="${key##*\'}"
if ! [[ "$key" =~ ^"ssh-rsa "[a-zA-Z0-9/+]+" "[a-zA-Z0-9._-]+"@"[a-zA-Z0-9._-]+$ ]]; then
if ! [[ "$key" =~ ^"ssh-rsa "[a-zA-Z0-9/+=]+" "[a-zA-Z0-9._-]+"@"[a-zA-Z0-9._-]+$ ]]; then
err "Unexpected output from 'vps install backup $server'. Can't find key." err "Unexpected output from 'vps install backup $server'. Can't find key."
echo "$out" | prefix " ${GRAY}|$NORMAL " >&2 echo "$out" | prefix " ${GRAY}|$NORMAL " >&2
echo " Extracted key:" >&2 echo " Extracted key:" >&2

5
bin/vps

@ -421,7 +421,10 @@ EOF
info "You can run this following command from an host having admin access to $dest:" info "You can run this following command from an host having admin access to $dest:"
echo " (Or send it to a backup admin of $dest)" >&2 echo " (Or send it to a backup admin of $dest)" >&2
public_key=$(ssh-keygen -y -f <(e "$private_key"$'\n'))
## We remove ending label (label will be added or not in the
## private key, and thus here, depending on the version of
## openssh-client)
public_key=$(ssh-keygen -y -f <(e "$private_key"$'\n') | sed -r 's/ [^ ]+@[^ ]+$//')
echo "ssh ${ssh_options[@]} myadmin@$dest ssh-key add '$public_key compose@$host'" echo "ssh ${ssh_options[@]} myadmin@$dest ssh-key add '$public_key compose@$host'"
} }

Loading…
Cancel
Save