#!/sbin/runscript opts="start stop restart" depend() { use dns need net } start() { ebegin "Starting BOINC" if [ ! -d ${RUNTIMEDIR} ] then einfo "Directory ${RUNTIMEDIR} not existing, creating now." /bin/mkdir ${RUNTIMEDIR} /bin/chown ${USER}:${GROUP} ${RUNTIMEDIR} if [ ! -d ${RUNTIMEDIR} ] then eerror "Directory ${RUNTIMEDIR} could not be created!" return 1 fi fi cd ${RUNTIMEDIR} if [ ! -f lockfile ] then einfo "File ${RUNTIMEDIR}/lockfile not existing, assuming first run." einfo "You need to setup an account on the BOINC project homepage beforehand! Go to http://boinc.berkeley.edu/ and locate your project." su boinc -c "${BOINCBIN} -show_projects" if [ ! -f lockfile ] then eerror "File ${RUNTIMEDIR}/lockfile still not created! You should setup ${RUNTIMEDIR} yourself." return 1 fi einfo "Done setting up!" fi start-stop-daemon --quiet --start --exec ${STARTSCRIPT} \ --chuid ${USER}:${GROUP} -- ${BOINCBIN} ${LOGFILE} eend $? } stop() { ebegin "Stopping BOINC" start-stop-daemon --stop --quiet --exec ${BOINCBIN} eend $? } restart() { svc_stop sleep 10 svc_start }