Skip to content

Commit 0f2406a

Browse files
committed
Fix and simplify timeout seds
1 parent b022639 commit 0f2406a

1 file changed

Lines changed: 4 additions & 17 deletions

File tree

‎root/docker-entrypoint.sh‎

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,10 @@ else
88
BIND_PROTO="[::]:2375 v4v6"
99
fi
1010

11-
sed "s/@@BIND_PROTO@@/${BIND_PROTO}/g" /templates/haproxy.cfg > /run/haproxy/haproxy.cfg
12-
13-
if [ "${TIMEOUT_CLIENT}" ]; then
14-
true
15-
else
16-
TIMEOUT_CLIENT="10"
17-
fi
18-
19-
sed "s/@@TIMEOUT_CLIENT@@/${TIMEOUT_CLIENT}m/g" /templates/haproxy.cfg > /run/haproxy/haproxy.cfg
20-
21-
if [ "${TIMEOUT_SERVER}" ]; then
22-
true
23-
else
24-
TIMEOUT_SERVER="10"
25-
fi
26-
27-
sed "s/@@TIMEOUT_SERVER@@/${TIMEOUT_SERVER}m/g" /templates/haproxy.cfg > /run/haproxy/haproxy.cfg
11+
sed -e "s/@@BIND_PROTO@@/${BIND_PROTO}/g" \
12+
-e "s/@@TIMEOUT_CLIENT@@/${TIMEOUT_CLIENT:-10}m/g" \
13+
-e "s/@@TIMEOUT_SERVER@@/${TIMEOUT_SERVER:-10}m/g" \
14+
/templates/haproxy.cfg > /run/haproxy/haproxy.cfg
2815

2916
echo '
3017
───────────────────────────────────────

0 commit comments

Comments
 (0)