commit 358880697ed27da7ef926060347a9c4013b1d487 Author: Anatoly Kopyl Date: Sat Apr 3 15:17:27 2021 +0300 Initial commit diff --git a/sshukh.plugin.zsh b/sshukh.plugin.zsh new file mode 100755 index 0000000..1455f81 --- /dev/null +++ b/sshukh.plugin.zsh @@ -0,0 +1,14 @@ +#!/bin/sh +output=$(ssh "$@") +if [ $? -eq 255 ]; +then + host=$(cut -d'@' -f2 <<< $1) + while true; do + read -p "Update known_hosts? [y/n] " yn + case $yn in + [Yy]* ) ssh-keygen -R $host && ssh "$@"; break;; + [Nn]* ) exit;; + * ) echo "Please answer y or n.";; + esac + done +fi