diff --git a/bin/0km b/bin/0km index c9d19ff..e1171e6 100755 --- a/bin/0km +++ b/bin/0km @@ -768,10 +768,17 @@ vps_install_backup() { return 1 fi - out="${out%$'\n'}" - out="${out#*$'\n'}" - key="${out%\'*}" - key="${key##*\'}" + ## Format of output: + ## + ## II Entry for service rsync-backup is already present in '/opt/apps/myc-deploy/compose.yml'. + ## II You can run this following command from an host having admin access to core-07.0k.io: + ## (Or send it to a backup admin of core-07.0k.io) + ## ssh -p 10023 myadmin@core-07.0k.io ssh-key add 'ssh-rsa AAAAAAAD...QCJ\ + ## 8HH6pVgEpu1twyxpr9xTt7eh..WaJdgPoxmiEwGfjMMNGxs39ggOTKUuSFSmOv8TiA1fzY\ + ## s85hF...dKP1qByJU1k= compose@odoo.sikle.fr' + + key="ssh-rsa ${out##*\'ssh-rsa }" ## remove everything before last "'ssh-rsa" + key="${key%\'*}" ## remove everything after last ' 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."