mirror of
https://github.com/anatolykopyl/sshukh.git
synced 2026-03-26 12:55:02 +00:00
Initial commit
This commit is contained in:
14
sshukh.plugin.zsh
Executable file
14
sshukh.plugin.zsh
Executable file
@@ -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
|
||||||
Reference in New Issue
Block a user