added some utilities

externalip - returns the oneline plaintext well-formatted IP you face internet with
ssh-fingerprint - echoes a SHA256 (default) or an MD5 (on request) fingerprint of the provided ssh key
This commit is contained in:
Bryan Joshua Pedini 2020-01-09 18:31:49 +01:00
parent b9bdf077a3
commit 69308f9550
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,4 @@
#!/bin/bash
curl http://ipecho.net/plain
echo

View File

@ -0,0 +1,23 @@
#!/usr/bin/env bash
md5=false
key=""
# command-line parameters
for prm in "$@"; do
if [ "${prm:0:1}" == "-" ]; then
if [ "$prm" == "-5" ] || [ "$prm" == "--md5" ]; then
md5=true
fi
else
key="$prm"
fi
done
if [ "$key" == "" ]; then echo "Usage: $0 [ -5 | --md5 ] <key>"; exit 1; fi
if [ "$md5" == true ]; then
ssh-keygen -E md5 -lf "$key"
else
ssh-keygen -lf "$key"
fi