Adrià Vilanova MartÃnez | 2a08892 | 2024-07-06 23:34:44 +0200 | [diff] [blame] | 1 | #!/bin/sh |
2 | set -e | ||||
3 | |||||
4 | # first arg is `-f` or `--some-option` | ||||
5 | if [ "${1#-}" != "$1" ]; then | ||||
6 | set -- haproxy "$@" | ||||
7 | fi | ||||
8 | |||||
9 | if [ "$1" = 'haproxy' ]; then | ||||
10 | shift # "haproxy" | ||||
11 | # if the user wants "haproxy", let's add a couple useful flags | ||||
12 | # -W -- "master-worker mode" (similar to the old "haproxy-systemd-wrapper"; allows for reload via "SIGUSR2") | ||||
13 | # -db -- disables background mode | ||||
14 | set -- haproxy -W -db "$@" | ||||
15 | fi | ||||
16 | |||||
17 | exec "$@" |