[type/__mail_aliases] Add support for Alpine Linux

Alpine's DMA package has a typo and installs "newailases" instead of
"newaliases".
I adjusted the code-remote to only run newaliases if it is available.
Otherwise, tough luck, user gotta either fix his system or run manually.
This commit is contained in:
Dennis Camera 2020-06-22 14:02:42 +02:00
parent 27b832f212
commit aa605cada4
2 changed files with 5 additions and 3 deletions

View file

@ -28,7 +28,7 @@ check_file() {
fi fi
} }
case $("$__explorer/os") case $("${__explorer}/os")
in in
(freebsd|openbsd|solaris) (freebsd|openbsd|solaris)
check_file /etc/mail/aliases check_file /etc/mail/aliases
@ -36,7 +36,7 @@ in
# default # default
found /etc/mail/aliases found /etc/mail/aliases
;; ;;
(debian|devuan|ubuntu) (alpine|debian|devuan|ubuntu)
check_file /etc/aliases check_file /etc/aliases
# default # default

View file

@ -142,7 +142,9 @@ if ! cmp -s "${aliases_file}" "${aliases_file}.tmp"
then then
# aliases file was modified, replace and run `newaliases`. # aliases file was modified, replace and run `newaliases`.
mv "${aliases_file}.tmp" "${aliases_file}" mv "${aliases_file}.tmp" "${aliases_file}"
newaliases
# run newaliases if present
command -v newaliases >/dev/null 2>&1 && newaliases || true
else else
# no modifications were made, delete the temp file. # no modifications were made, delete the temp file.
rm "${aliases_file}.tmp" rm "${aliases_file}.tmp"