aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@libreoffice.org>2016-10-19 13:09:24 +0200
committerGuilhem Moulin <guilhem@libreoffice.org>2016-10-19 13:09:24 +0200
commit8c462b2bc3b624b8dbcae88a03843b338f2b368e (patch)
tree2e3d397ab50aaddac7ddc31ee61877b9c651af79
parent52ae50f9f050b84cd0fb9aaec9a299c60d22b985 (diff)
Improve listing of ssh keys and exported files.
-rwxr-xr-xtdfvm-install12
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