#!/bin/bash
# info: restart dns service
# options: NONE
#
# The function tells BIND service to reload dns zone files.


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

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


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

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


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

exit
