#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
##
##  rc.pureftpd -- Run-Commands for PureFTPD
##

%config
    pureftpd_enable="yes"

%start -p 200 -u root
    if opServiceEnabled pureftpd; then
        @l_prefix@/sbin/pure-ftpd </dev/null &
        echo "$!" >@l_prefix@/var/pureftpd/pureftpd.pid
    fi

%stop -p 200 -u root
    if opServiceEnabled pureftpd; then
        kill -TERM `cat @l_prefix@/var/pureftpd/pureftpd.pid`
    fi

%restart -u root
    if opServiceEnabled pureftpd; then
        kill -TERM `cat @l_prefix@/var/pureftpd/pureftpd.pid`
        sleep 2
        @l_prefix@/sbin/pure-ftpd </dev/null &
        echo "$!" >@l_prefix@/var/pureftpd/pureftpd.pid
    fi

