Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sed: unmatched '/' on configuration change #104

Closed
pitpalme opened this issue Mar 25, 2022 · 1 comment
Closed

sed: unmatched '/' on configuration change #104

pitpalme opened this issue Mar 25, 2022 · 1 comment

Comments

@pitpalme
Copy link

I've set up boky/postfix in docker-compose.yml.

When I had to change RELAYHOST settings and recreated + restarted container (docker compose up -d) I got

sed: unmatched '/'

within container logs.

I tracked it down to:

if ! grep -F "$SASL_RELAYHOST $RELAYHOST_USERNAME:$RELAYHOST_PASSWORD" /etc/postfix/sasl_passwd; then
sed -i -e "s/^$SASL_RELAYHOST .*$/d" /etc/postfix/sasl_passwd
echo "$SASL_RELAYHOST $RELAYHOST_USERNAME:$RELAYHOST_PASSWORD" >> /etc/postfix/sasl_passwd
fi

I tried to guess, what sed is supposed to do here, but I'm not sure.
Is the idea, to delete any old "SASL_RELAYHOST" configuration from sasl_password (/d looks like someone wanted to delete something) and than reconfigure it (echo) using currently values?

In this case, code would, IMHO be:

sed -i -e "/^$SASL_RELAYHOST .*$/d" /etc/postfix/sasl_passwd
@bokysan
Copy link
Owner

bokysan commented Mar 28, 2022

You are correct. Will be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants