#!/bin/bash
# info: restart mail service
# options: NONE
#
# The function tells Exim service to reload configuration files.


#----------------------------------------------------------#
#                    Variable&Function                     #
#----------------------------------------------------------#

# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh


#----------------------------------------------------------#
#                       Action                             #
#----------------------------------------------------------#

if [ "$MAIL_SYSTEM" = 'exim' ]; then
    /etc/init.d/exim reload  >/dev/null 2>&1
    if [ $? -ne 0 ]; then
        /etc/init.d/exim restart >/dev/null 2>&1
        if [ $? -ne 0 ]; then
            exit $E_RESTART
        fi
    fi
fi


#----------------------------------------------------------#
#                       Vesta                              #
#----------------------------------------------------------#

exit
