freebsd-ports/net/boinc-client/files/boinc.sh.in
Pav Lucistnik 2571a1881c - Update to 5.2.15
- Take over maintainership
- Stop supporting this on FreeBSD 4.X

Approved by:	old maintainer (takeover)
2006-03-15 10:44:46 +00:00

50 lines
977 B
Bash

#!/bin/sh
#
# $FreeBSD$
# 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"