Skip to content

Commit 4e118ad

Browse files
authored
check variables if exist
1 parent 56e12ad commit 4e118ad

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

haproxy/docker-entrypoint.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#!/bin/bash
22

33
#fix variable _name to not have /
4-
export FRONTEND_NAME="${FRONTEND_NAME//\//}"
5-
export BACKEND_NAME="${BACKEND_NAME//\//}"
4+
if [ -n "$FRONTEND_NAME" ]; then
5+
export FRONTEND_NAME="${FRONTEND_NAME//\//}"
6+
fi
7+
if [ -n "$BACKEND_NAME" ]; then
8+
export BACKEND_NAME="${BACKEND_NAME//\//}"
9+
fi
610

711
# haproxy not directly configured within /usr/local/etc/haproxy/haproxy.cfg
812
if ! test -e /usr/local/etc/haproxy/haproxy.cfg; then

0 commit comments

Comments
 (0)