Skip to content

Commit 987b111

Browse files
thohngnemchik
andauthored
Update root/etc/cont-init.d/50-config
Avoid grep -E, change to regex Co-authored-by: Eric Nemchik <eric@nemchik.com>
1 parent 8cb08da commit 987b111

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

root/etc/cont-init.d/50-config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fi
5858

5959
# if DB_HOST contains a port and DB_HOST is not a IPv6 without brackets [..]
6060
# support ipv4:port, [ipv6]:port, and domain:port
61-
if echo "$DB_HOST" | grep -qE ':[0-9]+$' && ! echo "$DB_HOST" | grep -qE '^(:{0,2}[a-fA-F0-9]{1,4})+$'; then
61+
if [[ ${DB_HOST} =~ :[0-9]+$ ]] && ! [[ ${DB_HOST} =~ ^(:{0,2}[a-fA-F0-9]{1,4})+$ ]]; then
6262
DB_HOST_PORT="${DB_HOST}"
6363
fi
6464

0 commit comments

Comments
 (0)