Fix #104: Inproper usage of sed

A small error where sed was called wrongly ('s/.../d') instead of
'/.../d' was causing an error `sed: unmatched '/' on configuration
change`.

This commit should fix the issue.
This commit is contained in:
Bojan Čekrlić 2022-03-28 19:49:31 +02:00
parent fd5c00c1bc
commit 156b45d9f7

View file

@ -200,7 +200,7 @@ postfix_setup_relayhost() {
echo -e " using username ${emphasis}$RELAYHOST_USERNAME${reset} and password ${emphasis}(redacted)${reset}."
if [[ -f /etc/postfix/sasl_passwd ]]; then
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
sed -i -e "/^$SASL_RELAYHOST .*$/d" /etc/postfix/sasl_passwd
echo "$SASL_RELAYHOST $RELAYHOST_USERNAME:$RELAYHOST_PASSWORD" >> /etc/postfix/sasl_passwd
fi
else