--- config/rootfiles/core/94/update.sh | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/config/rootfiles/core/94/update.sh b/config/rootfiles/core/94/update.sh index 6560662..1b9eed7 100644 --- a/config/rootfiles/core/94/update.sh +++ b/config/rootfiles/core/94/update.sh @@ -70,6 +70,11 @@ EOF
fcrontab -z &>/dev/null
+# dma files +mkdir /etc/alternatives +mkdir /var/lib/alternatives +/usr/sbin/alternatives --install /usr/sbin/sendmail sendmail /usr/sbin/sendmail.dma 20 + # Start services /etc/init.d/dnsmasq start /etc/init.d/sshd start
--- 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
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
Hi,
these changes look good, you are missing the Signed-off-by: line though. I will merge this and add it in, but please take care about this the next time.
-Michael
On Thu, 2015-10-15 at 12:18 +0200, Alexander Marx wrote:
config/rootfiles/core/94/update.sh | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/config/rootfiles/core/94/update.sh b/config/rootfiles/core/94/update.sh index 6560662..1b9eed7 100644 --- a/config/rootfiles/core/94/update.sh +++ b/config/rootfiles/core/94/update.sh @@ -70,6 +70,11 @@ EOF
fcrontab -z &>/dev/null
+# dma files +mkdir /etc/alternatives +mkdir /var/lib/alternatives +/usr/sbin/alternatives --install /usr/sbin/sendmail sendmail /usr/sbin/sendmail.dma 20
# Start services /etc/init.d/dnsmasq start /etc/init.d/sshd start