Closed matthiasries closed 2 weeks ago
The return code of --version
is 0 if the config is parsed correctly and 1 otherwise. So already already gives the behaviour you want.
You can also use --show-tls
for that. That will also parse the whole config
--show-tls
works for me --version
and --help
return 1 on my old openvpn. tested it on a newer version, works.
I wanted to know if a patch with this parameter / non intrusive "feature" would have a chance to be accepted. If someone except for me wants a check feature. But I guess if there is a work around than there is no need for more parameters.
Hi, is there interest for a --check-syntax parameter. Using this parameter would check the syntax of the config file and the remaining parameters, then exit with rc 0 or rc 1 in case of a syntax error.
I'm not sure if it should be call syntax-check, sanity-check or something else.
I almost get this behaviour if I add --version as the last parameter and check stdout for the string "OpenVPN". The return code of openvpn is of course not 0
This would allow for a check in automation/deployment. Ansible for example has the option to validate changes before applying them.