MINOR: haproxy: Add `-cc` argument
authorMaximilian Mader <max@bastelstu.be>
Sat, 5 Jun 2021 22:50:22 +0000 (00:50 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 8 Jun 2021 09:17:19 +0000 (11:17 +0200)
commitfc0cceb08a5e11a5e767e3a1d4d44901c454a850
tree08eb5cfae0a9f50137bf38821d4596b021af09f6
parent29c6cd7d8a37222f9f8154279c2957e2e7730a63
MINOR: haproxy: Add `-cc` argument

This patch adds the `-cc` (check condition) argument to evaluate conditions on
startup and return the result as the exit code.

As an example this can be used to easily check HAProxy's version in scripts:

    haproxy -cc 'version_atleast(2.4)'

This resolves GitHub issue #1246.

Co-authored-by: Tim Duesterhus <tim@bastelstu.be>
doc/configuration.txt
doc/management.txt
include/haproxy/cfgparse.h
include/haproxy/global-t.h
reg-tests/startup/check_condition.vtc [new file with mode: 0644]
src/cfgparse.c
src/haproxy.c