make script respect $TMPDIR

This commit is contained in:
Joel Beckmeyer 2023-08-07 09:07:03 -04:00
parent a1eaf76575
commit 331af7f488

View File

@ -1,5 +1,6 @@
#!/bin/sh
tmpfile=$(mktemp /tmp/ssh-check-host-fingerprints.tmp.XXXXXX)
tmpdir=${TMPDIR:-/tmp}
tmpfile=$(mktemp "$tmpdir"/ssh-check-host-fingerprints.tmp.XXXXXX)
ssh-keyscan -p "$2" "$1" 2>/dev/null > "$tmpfile"
if [ -s "$tmpfile" ]; then
fingerprints=$(ssh-keygen -lf "$tmpfile" 2>/dev/null | awk '{print $2}')