OpenVPN Exit status

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
rashod
OpenVpn Newbie
Posts: 1
Joined: Wed Feb 13, 2019 2:48 pm

OpenVPN Exit status

Post by rashod » Wed Feb 13, 2019 3:16 pm

Hello!
The problem is as follows:
It is required to determine the success of the connection, analyzing the return code, but when using the command

Code: Select all

openvpn --config path2config.ovpn
the output to the console stops at "Initialization Sequence Completed" and until I interrupt the process (Ctrl+C) I cannot perform any actions (in fact, all I want to do is echo $?).
If you use the "--daemon" option, then "echo $?" always returns "0", regardless of whether the connection is established or not.
Has anyone come across such a problem?

Post Reply