#!/bin/sh
#
# $FreeBSD: ports/net/boinc-client/files/boinc.sh.in,v 1.4 2006/03/15 10:44:46 pav Exp $
# PROVIDE: boinc
# REQUIRE: LOGIN
# KEYWORD: shutdown
. %%RC_SUBR%%
name="boinc"
rcvar=`set_rcvar`
boinc_user=%%BOINC_USER%%
boinc_home=%%BOINC_HOME%%
boinc_flags="-dir ${boinc_home}"
program_file=boinc_client
program_path=%%PREFIX%%/bin/${program_file}
syslog_facility=daemon.err
load_rc_config $name
: ${boinc_enable="NO"}
start_cmd=boinc_start
stop_cmd=boinc_stop
boinc_start() {
if checkyesno boinc_enable
then
if [ ! -x ${program_path} ]
then
logger -sp ${syslog_facility} -t ${program_file} \
"unable to start: ${program_path} is missing."
exit 72
fi
if ps axo ucomm | egrep ${program_file}; then
logger -sp ${syslog_facility} -t ${program_file} \
"unable to start: ${program_file} is already running."
exit 72
fi
echo "Starting BOINC client."
idprio 31 su - ${boinc_user} -c "${program_path} ${boinc_flags} >/dev/null &"
fi
}
boinc_stop() {
killall ${program_file} 2> /dev/null
}
run_rc_command "$1"
syntax highlighted by Code2HTML, v. 0.9.1