[type/__dma] Fix mailname

This commit is contained in:
Dennis Camera 2020-06-01 19:21:41 +02:00
parent 99d58672c4
commit 0657ac4f11
2 changed files with 26 additions and 32 deletions

View file

@ -2,12 +2,36 @@
CONF_PATH=/etc/dma # set in Makefile CONF_PATH=/etc/dma # set in Makefile
# Determine mailname
if test -f "${__object}/parameter/mailname"
then
mailname=$(cat "${__object}/parameter/mailname")
else
case $(cat "${__global}/explorer/os")
in
(debian|devuan|ubuntu)
# On Debian-like systems use /etc/mailname unless --mailname is used
mailname='/etc/mailname'
;;
(*)
mailname=$__target_fqdn
;;
esac
fi
# Generate config # Generate config
conf_should=$( conf_should=$(
if test -s "${__object}/parameter/smart-host" if test -s "${__object}/parameter/smart-host"
then then
printf 'SMARTHOST %s\n' "$(cat "${__object}/parameter/smart-host")" printf 'SMARTHOST %s\n' "$(cat "${__object}/parameter/smart-host")"
#printf 'AUTHPATH %s\n' "$(cat "${__type}/ fi
printf 'MAILNAME %s\n' "${mailname}"
if test -s "${__object}/explorer/auth_conf"
then
printf "AUTHPATH %s\n" "$(cat "${__object}/explorer/auth_conf")"
fi fi
case $(cat "${__object}/parameter/security") case $(cat "${__object}/parameter/security")
@ -68,11 +92,6 @@ conf_should=$(
echo 'NULLCLIENT' echo 'NULLCLIENT'
fi fi
if test -s "${__object}/explorer/auth_conf"
then
printf "AUTHPATH %s\n" "$(cat "${__object}/explorer/auth_conf")"
fi
) )
conf_should=$(echo "$conf_should" | sort -s -k 1,1) conf_should=$(echo "$conf_should" | sort -s -k 1,1)

View file

@ -1,32 +1,7 @@
#!/bin/sh -e #!/bin/sh -e
os=$(cat "${__global}/explorer/os")
# mailname: default behaviour is different on certain systems
if test -f "${__object}/parameter/mailname"
then
mailname=$(cat "${__object}/parameter/mailname")
else
# Otherwise use the hostname
mailname=$(cat "${__global}/explorer/hostname")
fi
case $os
in
(debian|devuan|ubuntu)
# On Debian-like systems use /etc/mailname
if test -f "${__object}/parameter/mailname"
then
echo "$mailname" | __file '/etc/mailname' --state present \
--mode 0644 --owner root --group root --source -
fi
mailname='/etc/mailname'
;;
esac
# Install DMA # Install DMA
case $os case $(cat "${__global}/explorer/os")
in in
(debian|devuan|ubuntu) (debian|devuan|ubuntu)
__package dma --state present __package dma --state present