diff options
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/.local/bin/clean_local_ssh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/.local/bin/clean_local_ssh b/bin/.local/bin/clean_local_ssh new file mode 100644 index 0000000..54b67a9 --- /dev/null +++ b/bin/.local/bin/clean_local_ssh @@ -0,0 +1,17 @@ +#!/bin/sh -e + +_known_hosts="$HOME/.ssh/known_hosts" + +grep localhost "$_known_hosts" + +printf "remove these entries? [y/N] " +read -r REMOVE +case "$REMOVE" in + [Y|y]) + grep -v localhost "$_known_hosts" | tee "$_known_hosts.new" + mv "$_known_hosts.new" "$_known_hosts" + ;; + *) + exit 1 + ;; +esac |
