diff options
-rwxr-xr-x | tdfvm-install | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tdfvm-install b/tdfvm-install index ed4c8e8..22226ca 100755 --- a/tdfvm-install +++ b/tdfvm-install @@ -271,12 +271,18 @@ virsh -c "$LIBVIRT_URI" console "$VM_NAME" --safe >/dev/null fi echo - echo "SSH hostkey fingerprints:" - find "$VMTMPDIR/virtfs" -maxdepth 1 -type f -name 'ssh_host_*_key.pub' \ - -execdir ssh-keygen -lf {} \; | sed 's/^/\t/' + sshkeys=$(find "$VMTMPDIR/virtfs" -maxdepth 1 -type f -name 'ssh_host_*_key.pub') + if [ "$sshkeys" ]; then + echo "SSH hostkey fingerprints:" + for pk in $sshkeys; do + ssh-keygen -lf "$pk" + done | sed 's/^/\t/' + fi ) >&2 if [ ${OUTPUT+x} ]; then find "$VMTMPDIR/virtfs" -name '*.pub' -print0 \ | xargs -r0 cp --no-preserve=mode -t "$OUTPUT" + printf "\nExported files:\n" >&2 + find "$OUTPUT" -type f -printf '\t%p\n' >&2 fi |