#!/bin/bash
# info: restart cron service
# options: NONE
#
# The function tells crond service to reread its configuration files.


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

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


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

# Parsing config / or just source config
if [ "$CRON_SYSTEM" = 'crond' ]; then
    /etc/init.d/crond 'reload' >/dev/null 2>&1
    if [ $? -ne 0 ]; then
        /etc/init.d/crond 'restart' >/dev/null 2>&1
        if [ $? -ne 0 ]; then
            exit $E_RESTART
        fi
    fi
fi


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

exit
