#!/bin/sh # Place BOINC INIT script. config() { NEW="$1" OLD="`dirname $NEW`/`basename $NEW .new`" # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy rm $NEW fi # Otherwise, we leave the .new copy for the admin to consider... } config etc/rc.d/rc.boinc-client.new # Add rc.boinc-client service into rc.local INIT script run=`grep ". /etc/rc.d/rc.boinc-client" etc/rc.d/rc.local` if [[ "${run}" == "" ]]; then cat << EOF >> etc/rc.d/rc.local # To disable BOINC chmod rc.boinc-client to 644 if [ -x /etc/rc.d/rc.boinc-client ]; then . /etc/rc.d/rc.boinc-client start fi EOF fi # Add rc.boinc-client service into rc.local_shutdown script run=`grep ". /etc/rc.d/rc.boinc-client" etc/rc.d/rc.local_shutdown` if [[ "${run}" == "" ]]; then cat << EOF >> etc/rc.d/rc.local_shutdown # To disable BOINC chmod rc.boinc-client to 644 if [ -x /etc/rc.d/rc.boinc-client ]; then . /etc/rc.d/rc.boinc-client stop fi EOF fi