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

%config
    uucp_enable="yes"

%common
    uucp_pidfile="@l_prefix@/var/uucp/run/uucpd.pid"
    uucp_start () {
        ( @l_prefix@/sbin/uucpd uucp @l_prefix@/sbin/uucico -l \
          </dev/null >/dev/null 2>&1 &
          echo "$!" >$uucp_pidfile
        ) </dev/null >/dev/null 2>&1
    }
    uucp_stop () {
        if [ -f $uucp_pidfile ]; then
            kill -TERM `cat $uucp_pidfile`
            sleep 1
        fi
    }

%start -p 200 -u root
    opServiceEnabled uucp || exit 0
    uucp_start

%stop -p 200 -u root
    opServiceEnabled uucp || exit 0
    uucp_stop

%restart -u root
    opServiceEnabled uucp || exit 0
    uucp_stop
    uucp_start

