I have a script I made for work that will call a function that takes an argument. I use the arguments to ssh
into our servers. My question is: Is there a way to call the method so that if/when I get disconnected from our servers, It will automatically call the script? So for example, I can ssh
into one of our servers. We have a reverse-ssh
tunnel set up so after an hour the connection closes. I want it so that after the disconnection, the script will be called again prompting for a hostname.
#!/bin/bash
echo "Provide hostname: "
read host
createSSHFunction()
{
arg1=$1
ssh $host
}
createSSHFunction $host