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

%config
    samba_enable="yes"

%start -p 200 -u root
    opServiceEnabled samba || exit 0
    @l_prefix@/sbin/smbd -D
    @l_prefix@/sbin/nmbd -D

%stop -p 200 -u root
    opServiceEnabled samba || exit 0
    kill -TERM `cat @l_prefix@/var/samba/run/smbd.pid` 
    kill -TERM `cat @l_prefix@/var/samba/run/nmbd.pid` 

%restart -u root
    opServiceEnabled samba || exit 0
    kill -TERM `cat @l_prefix@/var/samba/run/smbd.pid` 
    kill -TERM `cat @l_prefix@/var/samba/run/nmbd.pid` 
    sleep 2
    @l_prefix@/sbin/smbd -D
    @l_prefix@/sbin/nmbd -D

