summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2020-06-15 13:23:10 +0200
committerFlorian Pritz <bluewind@xinu.at>2021-02-12 13:36:53 +0100
commit18ae31f04b37c89a674da89061068d682c38a637 (patch)
treee815415051963e2cb973c76dba9a0f00765f2391
parent62b297137cc2fa0ad2cc9c94c32d7fc03b8cc80a (diff)
downloadbin-18ae31f04b37c89a674da89061068d682c38a637.tar.gz
bin-18ae31f04b37c89a674da89061068d682c38a637.tar.xz
Add get-hosts
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xget-hosts7
1 files changed, 7 insertions, 0 deletions
diff --git a/get-hosts b/get-hosts
new file mode 100755
index 0000000..78d9c31
--- /dev/null
+++ b/get-hosts
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# Output filtered list of hostnames from known_hosts
+
+cut -d\ -f1 ~/.ssh/known_hosts ~/.ssh/known_hosts_work | tr , "\n" \
+ | sed -r 's#(_ecdsa|_rsa|_ed25519|_dsa)$##' | sort -u \
+ | grep "$@"