diff options
Diffstat (limited to 'mail/dcc-dccd/files/dccd.sh.in')
-rw-r--r-- | mail/dcc-dccd/files/dccd.sh.in | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/mail/dcc-dccd/files/dccd.sh.in b/mail/dcc-dccd/files/dccd.sh.in new file mode 100644 index 000000000000..edb06235129b --- /dev/null +++ b/mail/dcc-dccd/files/dccd.sh.in @@ -0,0 +1,72 @@ +#!/bin/sh +# +# PROVIDE: dccd +# REQUIRE: LOGIN +# BEFORE: mail +# KEYWORD: shutdown + +# +# Add the following lines to /etc/rc.conf: +# +#dccd_enable="YES" +# +# and in %%DCCHOME%%/dcc_conf change: +# +#DCCD_ENABLE=off +# +# to: +# +#DCCD_ENABLE=on +# +# +# See %%DCCHOME%%/dcc_conf to configure startup options +# + +. %%RC_SUBR%% + +name=dccd +rcvar=`set_rcvar` + +load_rc_config $name + +# Set defaults +: ${dccd_enable:="NO"} +: ${dccd_home="%%DCCHOME%%"} +: ${dccd_libexec="%%PREFIX%%/dcc/libexec"} +: ${dccd_conf="$dccd_home/dcc_conf"} + + +procname="${dccd_libexec}/dccd" +required_dirs="${dccd_home} ${dccd_libexec}" +required_files="${dccd_conf} ${dccd_libexec}/rcDCC" + +start_cmd="start_dccd" +stop_cmd="stop_dccd" +start_precmd="start_precmd" + + +start_precmd() +{ +X=`grep ^DCCD_ENABLE ${dccd_conf}` +eval $X +if [ "$DCCD_ENABLE" != "on" ] +then + echo "Warning ${X} needs to be on in ${dccd_conf} to start the dccd server" + return 1 +fi +} + +start_dccd() +{ + echo Starting dccd. + ${dccd_libexec}/rcDCC -m dccd start +} + +stop_dccd() +{ + echo Stopping dccd. + ${dccd_libexec}/rcDCC -m dccd stop +} + +run_rc_command "$1" + |