move bin to .local/bin
This commit is contained in:
18
dot_local/bin/executable_ssh-check-host-fingerprint
Normal file
18
dot_local/bin/executable_ssh-check-host-fingerprint
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
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}')
|
||||
for fingerprint in $fingerprints
|
||||
do
|
||||
if [ "$fingerprint" = "$3" ];
|
||||
then
|
||||
rm "$tmpfile"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
else
|
||||
rm "$tmpfile"
|
||||
exit 1
|
||||
fi
|
Reference in New Issue
Block a user