#!/bin/sh # # /etc/init.d/folding -- script to start and stop folding@home at boot # -- By chooper - Latest version can be found @ http://www.subversity.net # # Changelog # 20080221 Wrote it :-) # # Path to Folding@Home directory FAH_PATH="/path/to/folding-at-home" # Name of binary FAH_BIN="FAH504-Linux.exe" # Set the username and group to run Folding@Home as # (It is not recommended to run this as root) MY_USERNAME="your-username" MY_GROUP="your-password" # You probably don't need to change this PIDFILE="/var/run/folding.pid" if [ ! -x ${FAH_PATH}/${FAH_BIN} ]; then echo "Invalid permissions (FAH_PATH or FAH_BIN variables are incorrect)" exit 0 fi case "$1" in start) echo -n "Starting Folding@Home: " ${FAH_BIN} start-stop-daemon --start --quiet --background --chuid ${MY_USERNAME}:${MY_GROUP} --user ${MY_USERNAME} --group ${MY_GROUP} --chdir ${FAH_PATH} --exec ${FAH_PATH}/${FAH_BIN} --make-pidfile --pidfile ${PIDFILE} echo "." ;; stop) echo -n "Stopping Folding@Home: " ${FAH_BIN} start-stop-daemon --stop --signal 3 --quiet --user ${MY_USERNAME} --group ${MY_GROUP} --chdir ${FAH_PATH} --oknodo --pidfile ${PIDFILE} echo "." ;; restart) $0 stop $0 start ;; *) echo "Usage: /etc/init.d/folding {start|stop|restart}" exit 1 ;; esac exit 0