Is it possible to open an ssh session, run a command in this session, then open another ssh session and run some commands on this new ssh session, before going back to the first ssh session and repeating the process?
The purpose is to release an access point from a wireless controller in the first session and check that it has been migrated to the other controller in the second session. As there are many access points, I wanted to automate this process.
If spawn ssh merely initiates an ssh session from the shell, then it can only initiate one before closing it and initiating another. From my tests this is what is happening, I can't seem to have both ssh sessions open at the same time and use expect -i $spawn_id cmd send -i $spawn_id cmd to choose which ssh session I want to interact with via script.