-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# Normalize the input for DISABLE_IPV6 to lowercase | ||
DISABLE_IPV6_LOWER=$(echo "$DISABLE_IPV6" | tr '[:upper:]' '[:lower:]') | ||
|
||
# Check for different representations of 'true' and set BIND_CONFIG | ||
case "$DISABLE_IPV6_LOWER" in | ||
1|true|yes) | ||
BIND_CONFIG=":2375" | ||
;; | ||
*) | ||
BIND_CONFIG="[::]:2375 v4v6" | ||
;; | ||
esac | ||
|
||
# Process the HAProxy configuration template using sed | ||
sed "s/\${BIND_CONFIG}/$BIND_CONFIG/g" /usr/local/etc/haproxy/haproxy.cfg.template > /usr/local/etc/haproxy/haproxy.cfg | ||
|
||
# Command-line argument handling | ||
if [ "${1#-}" != "$1" ]; then | ||
set -- haproxy "$@" | ||
fi | ||
|
||
if [ "$#" -eq 0 ] || [ "$1" = 'haproxy' ]; then | ||
if [ "$1" = 'haproxy' ]; then | ||
shift | ||
fi | ||
set -- haproxy -W -db "$@" | ||
fi | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters