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

%config
    cvsd_enable="yes"

%start -p 200 -u root
    if opServiceEnabled cvsd; then
        @l_prefix@/sbin/cvsd
    fi

%stop -p 200 -u root
    if opServiceEnabled cvsd; then
        if [ -f @l_prefix@/var/cvsd/cvsd.pid ]; then
           kill `cat @l_prefix@/var/cvsd/cvsd.pid`
        fi
    fi

%restart -u root
    if opServiceEnabled cvsd; then
        if [ -f @l_prefix@/var/cvsd/cvsd.pid ]; then
           kill `cat @l_prefix@/var/cvsd/cvsd.pid`
           sleep 1
        fi
        @l_prefix@/sbin/cvsd
    fi

