I have a problem with my NordVPN account where I have to sometimes run the client upwards of 10 times, with their terrible CLI tool, until it finally successfully chooses a server that accepts my login.
I came across an old post here which I adapted to suit my needs, and it looks like this currently:
perl -e 'do { sleep(7); $_ = `nordvpn connect`; print $_; } until (m/connected/);'
It keeps running connect until it observes the word "connected" hopefully in the output. But I want to expand this one step further. When it successfully gets the keyword in the output, I want it then to 'mpv success.wav' or some similar thing, to play a simple .wav file located in the same directory. mpv works great for this.
Thanks very much in advance!