[2/2] Core94: fix for dma when postfix is installed
Message ID | 1444904308-15139-2-git-send-email-alexander.marx@ipfire.org |
---|---|
State | Accepted |
Commit | ee97ade8e40ece29913a2bd5af59cf94fe4941b1 |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (mail01.tremer.info [172.28.1.200]) by septima.ipfire.org (Postfix) with ESMTP id 62EC962006 for <patchwork@ipfire.org>; Thu, 15 Oct 2015 12:18:45 +0200 (CEST) Received: from hedwig.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 4A093A91; Thu, 15 Oct 2015 12:18:44 +0200 (CEST) Received: from nbk-edv.kappeln2011.lan (ip1f11b49c.dynamic.kabel-deutschland.de [31.17.180.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 8AF44236; Thu, 15 Oct 2015 12:18:38 +0200 (CEST) From: Alexander Marx <alexander.marx@ipfire.org> To: development@lists.ipfire.org Subject: [PATCH 2/2] Core94: fix for dma when postfix is installed Date: Thu, 15 Oct 2015 12:18:28 +0200 Message-Id: <1444904308-15139-2-git-send-email-alexander.marx@ipfire.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444904308-15139-1-git-send-email-alexander.marx@ipfire.org> References: <1444904308-15139-1-git-send-email-alexander.marx@ipfire.org> X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <http://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <http://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Message
Alexander Marx
Oct. 15, 2015, 9:18 p.m. UTC
--- config/rootfiles/core/94/update.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
Comments
Hi, the sed command is a bit messy. You can also use a difference character as a delimiter for the two fields like @. That would look like this: sed -e "s@usr/bin/sendmail@usr/bin/sendmail.postfix@g" ... That makes it more readable. You can also use the & character in the second half to get the matched string from the first half. That would look like this: sed -e "s@usr/bin/sendmail@&.postfix@" ... ...which is even shorter. I will merge this because you version is working, too. -Michael On Thu, 2015-10-15 at 12:18 +0200, Alexander Marx wrote: > --- > config/rootfiles/core/94/update.sh | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/config/rootfiles/core/94/update.sh > b/config/rootfiles/core/94/update.sh > index 1b9eed7..7b645e9 100644 > --- a/config/rootfiles/core/94/update.sh > +++ b/config/rootfiles/core/94/update.sh > @@ -70,7 +70,13 @@ EOF > > fcrontab -z &>/dev/null > > -# dma files > +# DMA - reconfigure Postfix if exists > +if [ -e /etc/postfix/main.cf ]; then > + mv /usr/sbin/sendmail /usr/sbin/sendmail.postfix > + /usr/sbin/alternatives --install /usr/sbin/sendmail sendmail > /usr/sbin/sendmail.postfix 15 > + sed -i 's/usr\/sbin\/sendmail/usr/sbin/sendmail.postfix/' > /opt/pakfire/db/rootfiles/postfix > +fi > +# DMA - configure dma as default mta > mkdir /etc/alternatives > mkdir /var/lib/alternatives > /usr/sbin/alternatives --install /usr/sbin/sendmail sendmail > /usr/sbin/sendmail.dma 20