I have a raspberry pi that I connected to my home network, but each time I reboot it the last numberIP address changes of value, so instead. Instead of calling ssh user@ipadresuser@ipaddress each time, I want to run a bash script to know which is the final numberaddress that works.
I'm trying to run ssh user@ipadressuser@ipaddress several times changing the last number of the ipIP address. I don't know how bash works, so I attempted to make a file .sh to do it:
for i in {1..100} do call=`ssh [email protected].$i` if [['$call'==*'user'*]]; then echo "$i" else : fi done My problems are:
- I don't print anything
- It stucksis stuck in the first call and it doesn't make the loop
So I want to know if there is a bash function to pass over a command when it's another device, because I know the name of my user and I only need to find my user name in the command output of the first line, and don't need to wait for more output.