summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/show-keys20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/show-keys b/scripts/show-keys
new file mode 100755
index 0000000..97e69f3
--- /dev/null
+++ b/scripts/show-keys
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+cd "${0%/*}/.."
+find hosts \
+ -type f \
+ -exec cat {} + \
+| tr -d '\r' \
+| sed '
+ s/^---- BEGIN SSH2 PUBLIC KEY ----$//
+ T
+ :a
+ N
+ s/\n---- END SSH2 PUBLIC KEY ----//
+ Ta
+ s/\n//g
+ s/^Comment: "\([^"]*\)"\(\S\+\)$/\2 \1/
+' \
+| sed '
+ s/^command="[^"]*"\(,\S\+\)\? //
+'