In my case I have to run openvpn
before ssh'ing into a server, and the openvpn
command echos out "Initialization Sequence Completed".
So, I want my script to setup the openvpn
and then ssh in.
My question is: How do you execute a command in bash in the background and await it to echo "completed" before running another program?
My current way of doing this is having 2 terminal panes open, one running:
sudo openvpn --config FILE
and in the other I run:
ssh SERVER
once the the first terminal pane has shown me the "Initialization Sequence Completed" text.
sudo openvpn --config FILE && ssh SERVER
would work. – Primine