Turned everything ito a function

This commit is contained in:
2021-04-03 15:37:23 +03:00
parent 358880697e
commit 53a9ea38e4

View File

@@ -1,7 +1,7 @@
#!/bin/sh
output=$(ssh "$@")
if [ $? -eq 255 ];
then
sshukh () {
output=$(ssh "$@")
if [ $? -eq 255 ];
then
host=$(cut -d'@' -f2 <<< $1)
while true; do
read -p "Update known_hosts? [y/n] " yn
@@ -11,4 +11,5 @@ then
* ) echo "Please answer y or n.";;
esac
done
fi
fi
}