[type/__dma] Fix mailname
This commit is contained in:
parent
99d58672c4
commit
0657ac4f11
2 changed files with 26 additions and 32 deletions
|
@ -2,12 +2,36 @@
|
|||
|
||||
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
|
||||
conf_should=$(
|
||||
if test -s "${__object}/parameter/smart-host"
|
||||
then
|
||||
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
|
||||
|
||||
case $(cat "${__object}/parameter/security")
|
||||
|
@ -68,11 +92,6 @@ conf_should=$(
|
|||
|
||||
echo 'NULLCLIENT'
|
||||
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)
|
||||
|
||||
|
|
|
@ -1,32 +1,7 @@
|
|||
#!/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
|
||||
case $os
|
||||
case $(cat "${__global}/explorer/os")
|
||||
in
|
||||
(debian|devuan|ubuntu)
|
||||
__package dma --state present
|
||||
|
|
Loading…
Reference in a new issue