OpenVPN: quit on proxy connection error

Solution 1:

I am confused here, why do you want your VPN to quit? Why not just generate an OpenVPN configuration file with multiple connection profiles, and let OpenVPN cycle between them on its own?

The xample from the OpenVPN man page seems to illustrate this.

      <connection>
      remote 198.19.34.56 1194 udp
      </connection>

      <connection>
      remote 198.19.34.56 443 tcp
      </connection>

      <connection>
      remote 198.19.34.56 443 tcp
      http-proxy 192.168.0.8 8080
      </connection>

      <connection>
      remote 198.19.36.99 443 tcp
      http-proxy 192.168.0.8 3128
      </connection>