#!/bin/sh # chkconfig: 345 93 14 # description: will start FAH client and CPU throttle as a service # author: Eric Wolf eric@n5ebw.com # date: 5/21/2010 # note: This script comes with no support, use at your own risk. #Edit the following line with your install directory INST_DIR="/opt/foldingathome" case $1 in 'start') #change to installation directory cd $INST_DIR #start folding echo "Starting to Fold!" ./fah < /dev/null > /dev/null 2>&1 #start CPU throttle, replace "25" with your desired CPU utilization #comment out if you do not wish to use CPU throttling. ./fahlimit -daemon -percent 25 ;; 'stop') echo "Stopping Folding@Home Client" #kill all folding process killall fah6 #kill the CPU throttle killall fahlimit ;; 'status') CPU_THROTTLE=`ps aux | grep "fahlimit -daemon" | grep -v grep | wc -l` FAH_PROC=`ps aux | grep "fah6" | grep -v grep | wc -l` if [ "$FAH_PROC" == "1" ] ; then echo "Folding Client: RUNNING" else echo "Folding Client: NOT RUNNING" fi if [ "$CPU_THROTTLE" == "1" ] ; then echo " CPU Throttle: RUNNING" else echo " CPU Throttle: NOT RUNNING" fi ;; *) #Do nothing echo "Invalid Option \"$1\". Doing nothing." ;; esac exit 0