I'm trying to set up a script that I can call up easily in a WM. The idea is to establish a socks tunnel via ssh to a known-good server and then start chromium with the appropriate environment variables...Then, wait until that instance of chromium exits and then unbind the port. The last part is important, because if left open, the script will fail to run again because the tunnel is still up.
However, when I run it, it just establishes the connection, starts chromium and then closes the connection...It doesn't wait for Chromium to close before continuing.
I've tried adding &, && and the wait function, but I think Chromium returns something after successful execution, which is triggering my script to continue.
ssh -f -N -M -S ~/socket -L 4771:localhost:4771 -p 1234 foo.bar.com chromium --proxy-server="socks://localhost:4771" && wait ssh -S socket -O exit foo.bar.com
I'm using Arch and ZSH as my shell.