Skip to content

Commit

Permalink
DBZ-7982 Replace egrep with grep
Browse files Browse the repository at this point in the history
  • Loading branch information
jpechane committed Jun 27, 2024
1 parent 77b8cb0 commit 61a9c11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions connect-base/2.7/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ case $1 in
env_var=`echo "$VAR" | sed -r "s/([^=]*)=.*/\1/g"`
prop_name=`echo "$VAR" | sed -r "s/^CONNECT_([^=]*)=.*/\1/g" | tr '[:upper:]' '[:lower:]' | tr _ .`
prop_value=`echo "$VAR" | sed -r "s/^CONNECT_[^=]*=(.*)/\1/g"`
if egrep -q "(^|^#)$prop_name=" $KAFKA_HOME/config/log4j.properties; then
if grep -Eq "(^|^#)$prop_name=" $KAFKA_HOME/config/log4j.properties; then
#note that no config names or values may contain an '@' char
sed -r -i "s@(^|^#)($prop_name)=(.*)@\2=${prop_value}@g" $KAFKA_HOME/config/log4j.properties
else
Expand Down Expand Up @@ -304,7 +304,7 @@ case $1 in
if [[ $env_var =~ ^CONNECT_ ]]; then
prop_name=`echo "$VAR" | sed -r "s/^CONNECT_([^=]*)=.*/\1/g" | tr '[:upper:]' '[:lower:]' | tr _ .`
prop_value=`echo "$VAR" | sed -r "s/^CONNECT_[^=]*=(.*)/\1/g"`
if egrep -q "(^|^#)$prop_name=" $KAFKA_HOME/config/connect-distributed.properties; then
if grep -Eq "(^|^#)$prop_name=" $KAFKA_HOME/config/connect-distributed.properties; then
#note that no config names or values may contain an '@' char
sed -r -i "s@(^|^#)($prop_name)=(.*)@\2=${prop_value}@g" $KAFKA_HOME/config/connect-distributed.properties
else
Expand Down
2 changes: 1 addition & 1 deletion kafka/2.7/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ case $1 in
env_var=`echo "$VAR" | sed "s/=.*//"`
if [[ $env_var =~ ^KAFKA_ && $env_var != "KAFKA_VERSION" && $env_var != "KAFKA_HOME" && $env_var != "KAFKA_LOG4J_OPTS" && $env_var != "KAFKA_JMX_OPTS" ]]; then
prop_name=`echo "$VAR" | sed -r "s/^KAFKA_(.*)=.*/\1/g" | tr '[:upper:]' '[:lower:]' | tr _ .`
if egrep -q "(^|^#)$prop_name=" $KAFKA_HOME/$CONFIG_FILE; then
if grep -Eq "(^|^#)$prop_name=" $KAFKA_HOME/$CONFIG_FILE; then
#note that no config names or values may contain an '@' char
sed -r -i "s%(^|^#)($prop_name)=(.*)%\2=${!env_var}%g" $KAFKA_HOME/$CONFIG_FILE
else
Expand Down

0 comments on commit 61a9c11

Please sign in to comment.