Added basic argument error checking, other minor usability adjustments, added NYC01 fingerprints

parent eb7d3461
# nyc01.jamieweb.net:22 SSH-2.0-OpenSSH_7.6p1
nyc01.jamieweb.net ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD4P/hx0ryz+yVfz8pWd8JotpOAn5ObHrOA4jfYUr3dF1/Uq208a3ZsRz1hqVJ5qxb7AkCXHvWCg2ZpITLcrkc5yoY//kZRmZObyE3b+aeEq+u4zo+dKkTY8gs7K22GmnGPC0jAic4StcaQTJ2jNccunzNWb0gft/iJqDzTrhVfj82zjrKrS+df4lWgiKmvwk1zVGo8R8SlrZ4dPn8Cjxx73J8Jfok4jD4fhxIvPJ/yW/e0SkdJ6Hd5NK4dE0D7S5cNpAlSVShWeD4MLRO76Cx4nOMl/+DwMUe72pcl9Pg9WcyfihrKdp0iUmuesewfXKSjLqR5PVeH1ymscnblxSE9
#!/bin/bash
host="$1"
echo "Getting LIVE fingerprint for '$host'..."
fingerprint=$(ssh-keyscan -4 -T 5 -t rsa -f "${host}/host" 2>&1)
host="${1}"
if [ -z "${host}" ]; then
echo "No argument given. Exiting."
exit
elif [ ! -s "${host}/host" ]; then
echo "Host '${host}' cannot be found at ${host}/host. Exiting."
exit
fi
full_host=$(<"${host}/host")
current_fingerprint=$(<"${host}/fingerprint")
echo "Getting LIVE fingerprint for '${host}' ($full_host)..."
fingerprint=$(ssh-keyscan -4 -T 5 -t rsa -f "${host}/host" 2>&1)
if diff -q <(echo "$fingerprint") <(echo "$current_fingerprint"); then
echo "The live fingerprint for '${host}' is the SAME as ${host}/fingerprint."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment