mirror of
https://github.com/anatolykopyl/sshukh.git
synced 2026-03-26 12:55:02 +00:00
Made the script trigger only on key verification fail
This commit is contained in:
@@ -14,9 +14,10 @@
|
|||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
sshukh () {
|
sshukh () {
|
||||||
output=$(\ssh "$@")
|
output=$(\ssh "$@" 2>&1)
|
||||||
if [ $? -eq 255 ];
|
echo $output
|
||||||
then
|
error=$(echo $output | tail -1)
|
||||||
|
if [[ "$error" == "Host key verification failed."* ]]; then
|
||||||
host=$(cut -d'@' -f2 <<< $1)
|
host=$(cut -d'@' -f2 <<< $1)
|
||||||
while true; do
|
while true; do
|
||||||
read yn"?Update known_hosts? [y/n] "
|
read yn"?Update known_hosts? [y/n] "
|
||||||
|
|||||||
Reference in New Issue
Block a user