#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
##
##  rc.bind -- Run-Commands for BIND Daemon
##

%config
    bind_enable="yes"
    bind_log_numfiles="5"
    bind_log_minsize="512K"
    bind_log_complevel="9"

%start -p 100 -u root
    if opServiceEnabled bind; then
        @l_prefix@/sbin/named
    fi

%stop -p 200 -u root
    if opServiceEnabled bind; then
        @l_prefix@/sbin/rndc stop
    fi

%restart -u root
    if opServiceEnabled bind; then
        @l_prefix@/sbin/rndc stop
        sleep 1
        @l_prefix@/sbin/named
    fi

%reload -u root
    if opServiceEnabled bind; then
        @l_prefix@/sbin/rndc reload
    fi

%daily -u root
    if opServiceEnabled bind; then
        shtool rotate -f \
            -n${bind_log_numfiles} -s${bind_log_minsize} \
            -d -z${bind_log_complevel} -o@l_musr@ -g@l_mgrp@ -m644 \
            -E '@l_prefix@/sbin/rndc reload' \
            @l_prefix@/var/bind/named.log 
    fi

