This commit is contained in:
Bart Sjerps
2026-04-20 10:00:31 +02:00
parent b505ef9dca
commit b14134c56c
12 changed files with 135 additions and 21 deletions
Executable
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/bash
DEL=""
deletehost() {
local host ip
host=$(echo $1 | awk -F@ '{print $NF}')
ip=$(host $host | awk '/has address/ {print $NF}' | head -1)
ssh-keygen -R $host
test -n "$ip" && ssh-keygen -R $ip
}
while getopts ":dh" OPT; do
case "$OPT" in
d) DEL=Y ;;
\?|h) usage >&2 ; exit 0 ;;
esac
done
shift $(expr $OPTIND - 1)
test -n "$DEL" && deletehost $@
ssh root@${1:-none}