Skip to content

Commit 205a944

Browse files
authored
Merge pull request #457 from infosiftr/newline-at-eof
If the provided rabbitmq.conf is missing a newline at EOF, add one before appending to it
2 parents 2a3ffff + 3644a01 commit 205a944

File tree

5 files changed

+5
-0
lines changed

5 files changed

+5
-0
lines changed

3.8-rc/alpine/docker-entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ rabbit_set_config() {
246246
"s/^[[:space:]]*(${sedKey}[[:space:]]*=[[:space:]]*)\S.*\$/\1${sedVal}/" \
247247
"$newConfigFile"
248248
if ! grep -qE "^${sedKey}[[:space:]]*=" "$newConfigFile"; then
249+
sed -i -e '$a\' "$newConfigFile" # https://github.com/docker-library/rabbitmq/issues/456#issuecomment-752251872 (https://unix.stackexchange.com/a/31955/153467)
249250
echo "$key = $val" >> "$newConfigFile"
250251
fi
251252
}

3.8-rc/ubuntu/docker-entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ rabbit_set_config() {
246246
"s/^[[:space:]]*(${sedKey}[[:space:]]*=[[:space:]]*)\S.*\$/\1${sedVal}/" \
247247
"$newConfigFile"
248248
if ! grep -qE "^${sedKey}[[:space:]]*=" "$newConfigFile"; then
249+
sed -i -e '$a\' "$newConfigFile" # https://github.com/docker-library/rabbitmq/issues/456#issuecomment-752251872 (https://unix.stackexchange.com/a/31955/153467)
249250
echo "$key = $val" >> "$newConfigFile"
250251
fi
251252
}

3.8/alpine/docker-entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ rabbit_set_config() {
246246
"s/^[[:space:]]*(${sedKey}[[:space:]]*=[[:space:]]*)\S.*\$/\1${sedVal}/" \
247247
"$newConfigFile"
248248
if ! grep -qE "^${sedKey}[[:space:]]*=" "$newConfigFile"; then
249+
sed -i -e '$a\' "$newConfigFile" # https://github.com/docker-library/rabbitmq/issues/456#issuecomment-752251872 (https://unix.stackexchange.com/a/31955/153467)
249250
echo "$key = $val" >> "$newConfigFile"
250251
fi
251252
}

3.8/ubuntu/docker-entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ rabbit_set_config() {
246246
"s/^[[:space:]]*(${sedKey}[[:space:]]*=[[:space:]]*)\S.*\$/\1${sedVal}/" \
247247
"$newConfigFile"
248248
if ! grep -qE "^${sedKey}[[:space:]]*=" "$newConfigFile"; then
249+
sed -i -e '$a\' "$newConfigFile" # https://github.com/docker-library/rabbitmq/issues/456#issuecomment-752251872 (https://unix.stackexchange.com/a/31955/153467)
249250
echo "$key = $val" >> "$newConfigFile"
250251
fi
251252
}

docker-entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ rabbit_set_config() {
246246
"s/^[[:space:]]*(${sedKey}[[:space:]]*=[[:space:]]*)\S.*\$/\1${sedVal}/" \
247247
"$newConfigFile"
248248
if ! grep -qE "^${sedKey}[[:space:]]*=" "$newConfigFile"; then
249+
sed -i -e '$a\' "$newConfigFile" # https://github.com/docker-library/rabbitmq/issues/456#issuecomment-752251872 (https://unix.stackexchange.com/a/31955/153467)
249250
echo "$key = $val" >> "$newConfigFile"
250251
fi
251252
}

0 commit comments

Comments
 (0)