From 7a58d80d9ec276002ed97ccd49ef05aa9b83cf3e Mon Sep 17 00:00:00 2001 From: lrob Date: Sat, 20 Feb 2016 12:41:55 +0100 Subject: [PATCH] check using mailx Keeping displaying the presence of exim4, sendmail, postfix, mailutils, and mailx in the right case. --- functions/check_deps.sh | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/functions/check_deps.sh b/functions/check_deps.sh index f6538bd63..88f8fb773 100644 --- a/functions/check_deps.sh +++ b/functions/check_deps.sh @@ -40,15 +40,23 @@ fi fn_deps_email(){ # Adds postfix to required dependencies if email notification is enabled if [ "${emailnotification}" == "on" ]; then - if [ -d /etc/exim4 ]; then - array_deps_required+=( exim4 ) - elif [ -d /etc/sendmail ]; then - array_deps_required+=( sendmail ) - elif [ -n "$(command -v dpkg-query)" ]; then - array_deps_required+=( mailutils postfix ) - elif [ -n "$(command -v yum)" ]; then - array_deps_required+=( mailx postfix ) - fi + if [ -f /usr/bin/mailx ]; then + if [ -d /etc/exim4 ]; then + array_deps_required+=( exim4 ) + elif [ -d /etc/sendmail ]; then + array_deps_required+=( sendmail ) + elif [ -n "$(command -v dpkg-query)" ]; then + array_deps_required+=( mailutils postfix ) + elif [ -n "$(command -v yum)" ]; then + array_deps_required+=( mailx postfix ) + fi + else + if [ -n "$(command -v dpkg-query)" ]; then + array_deps_required+=( mailutils postfix ) + elif [ -n "$(command -v yum)" ]; then + array_deps_required+=( mailx postfix ) + fi + fi fi }