freebsd-ports/net/boinc-client/files/boinc.sh
Pav Lucistnik ead1ef5a95 Add boinc-client, Berkeley Open Infrastructure for Network Computing.
BOINC is a software platform for distributed computing using volunteer
computer resources.

Many different projects can use BOINC.  SETI@HOME, for example, has
been redesigned to use BOINC and the astro/boinc-setiathome port
supercedes the astro/setiathome port.

WWW: http://boinc.berkeley.edu/

PR:		ports/72714
Submitted by:	J.R. Oldroyd <fbsd@opal.com>
2004-10-16 19:29:30 +00:00

61 lines
1.1 KiB
Bash

#!/bin/sh
#
# $FreeBSD: /tmp/pcvs/ports/net/boinc-client/files/Attic/boinc.sh,v 1.1 2004-10-16 19:29:30 pav Exp $
#
# Start or stop BOINC
#
. /etc/rc.subr
name="boinc"
rcvar=`set_rcvar`
boinc_user=%%BOINC_USER%%
boinc_home=%%BOINC_HOME%%
program_file=%%BOINC_BINARY%%
program_path=%%BOINC_DATADIR%%/client/${program_file}
[ -z "$boinc_enable" ] && boinc_enable="NO"
load_rc_config $name
case "$1" in
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 -n "BOINC "
idprio 31 su - ${boinc_user} -c "${program_path} >/dev/null &"
fi
;;
stop)
program=`expr ${program_file} : '^\(...................\).*$'`
killall ${program} 2> /dev/null
;;
restart)
$0 stop
$0 start
;;
status)
ps auxww | egrep ${program_file} | egrep -v "($0|egrep)"
;;
*)
echo "usage: ${name} {start|stop|restart|status}" >&2
exit 64
;;
esac