From 8c462b2bc3b624b8dbcae88a03843b338f2b368e Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 19 Oct 2016 13:09:24 +0200 Subject: Improve listing of ssh keys and exported files. --- tdfvm-install | 12 +++++++++--- 1 file 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 -- cgit v1.2.3