2 #/etc/rc.d/foldingathome-smp
4 # Starts the Folding@Home-SMP client in the background
8 .
/etc
/conf.d
/foldingathome-smp
10 PID
=`pidof -o %PPID /opt/fah-smp/fah6`
13 stat_busy
"Starting Folding@Home-SMP"
14 if [ -z "$PID" ]; then
15 if [ ! -z "$FAH_USER" ] ; then
16 if [ ! -d "/opt/fah-smp/$FAH_USER" ] ; then
17 mkdir
/opt
/fah-smp
/$FAH_USER
18 if [ -f /opt
/fah-smp
/client.cfg
] ; then
19 cp /opt
/fah-smp
/client.cfg
"/opt/fah-smp/$FAH_USER/client.cfg"
21 chown
-R $FAH_USER /opt
/fah-smp
/$FAH_USER
22 if [ ! -z "$FAH_GRP" ] ; then
23 chgrp
-R $FAH_GRP /opt
/fah-smp
/$FAH_USER
25 chgrp
-R users
/opt
/fah-smp
/$FAH_USER
28 cd /opt
/fah-smp
/$FAH_USER
29 su
$FAH_USER -c "/opt/fah-smp/fah6 -smp $FAH_CLIENT_FLAGS &> /opt/fah-smp/$FAH_USER/myfah.log" &
32 /opt
/fah-smp
/fah6
-smp $FAH_CLIENT_FLAGS &> /opt
/fah-smp
/myfah.log
&
35 if [ ! -z "$PID" -o $?
-gt 0 ]; then
38 add_daemon foldingathome-smp
44 stat_busy
"Stopping Folding@Home-SMP"
45 [ ! -z "$PID" ]&& kill $PID &> /dev
/null
49 rm_daemon foldingathome-smp
61 echo $
"Usage: $0 {start|stop|restart}"