#!@l_prefix@/bin/openpkg rc
##
##  rc.inn -- Run-Commands
##

%config
    inn_enable="$openpkg_rc_def"
    inn_nntpsend_enable="$openpkg_rc_def"

%status -u @l_rusr@ -o
    inn_usable="unknown"
    inn_active="no"
    @l_prefix@/bin/ctlinnd mode >/dev/null 2>&1 && inn_active="yes"
    echo "inn_enable=\"$inn_enable\""
    echo "inn_usable=\"$inn_usable\""
    echo "inn_active=\"$inn_active\""

%start -u @l_rusr@
    rcService inn enable yes || exit 0
    rcService inn active yes && exit 0
    @l_prefix@/libexec/inn/rc.news

%stop -u @l_rusr@
    rcService inn enable yes || exit 0
    rcService inn active no  && exit 0
    @l_prefix@/libexec/inn/rc.news stop
    sleep 2

%restart -u @l_rusr@
    rcService inn enable yes || exit 0
    rcService inn active no  && exit 0
    rc inn stop start

%reload -u @l_rusr@
    rcService inn enable yes || exit 0
    rcService inn active no  && exit 0
    @l_prefix@/bin/ctlinnd reload all rc.inn:reload

%quarterly -u @l_rusr@
    rcService inn enable yes || exit 0
    rcService inn active no  && exit 0
    rcService inn_nntpsend enable yes && @l_prefix@/bin/nntpsend || true

%daily -u @l_rusr@
    rcService inn enable yes || exit 0
    rcService inn active no  && exit 0
    @l_prefix@/libexec/inn/news.daily expireover lowmark delayrm

