aeb514f96f
PR: 109039 Submitted by: Dean Hollister <dean@odyssey.apana.org.au> (maintainer)
57 lines
889 B
Bash
57 lines
889 B
Bash
#!/bin/sh
|
|
#
|
|
# PROVIDE: dccifd
|
|
# REQUIRE: LOGIN
|
|
# BEFORE: mail
|
|
# KEYWORD: shutdown
|
|
|
|
#
|
|
# Add the following lines to /etc/rc.conf to enable dccifd:
|
|
#
|
|
#dccifd_enable="YES"
|
|
#
|
|
# See dccifd(8) for flags
|
|
#
|
|
|
|
. %%RC_SUBR%%
|
|
|
|
name=dccifd
|
|
rcvar=`set_rcvar`
|
|
|
|
load_rc_config $name
|
|
|
|
# Set defaults
|
|
: ${dccifd_enable:="NO"}
|
|
: ${dccifd_flags=""}
|
|
: ${dccifd_home="%%PREFIX%%/dcc"}
|
|
: ${dccifd_conf="$dccifd_home/dcc_conf"}
|
|
|
|
|
|
pidfile=${dccifd_pidfile:-"/var/run/dccifd.pid"}
|
|
command="${dccifd_home}/libexec/start-dccifd"
|
|
procname="${dccifd_home}/libexec/dccifd"
|
|
required_dirs="$dccifd_home"
|
|
required_files="${dccifd_conf}"
|
|
|
|
stop_postcmd="stop_postcmd"
|
|
start_precmd="start_precmd"
|
|
|
|
|
|
stop_postcmd()
|
|
{
|
|
rm -f $pidfile
|
|
}
|
|
|
|
start_precmd()
|
|
{
|
|
X=`grep DCCIFD_ENABLE ${dccifd_conf}`
|
|
eval $X
|
|
if [ "$DCCIFD_ENABLE" != "on" ]
|
|
then
|
|
echo "Warning ${X} needs to be on in ${dccifd_conf}"
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
run_rc_command "$1"
|
|
|