summaryrefslogtreecommitdiffstats
path: root/abs/core/runit-scripts/runitscripts/services/fah/run
blob: 1a3b8a66fbc5388029a16217a3dc77c86dffdd9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
export TERM=linux
. /etc/rc.conf
. /etc/rc.d/functions
configfile=/etc/fah-config.xml
. /etc/systemconfig
FOLDING_DIR=/data/storage/disk0/media/foldingathome/$hostname
mkdir -p $FOLDING_DIR
chown mythtv:mythtv $FOLDING_DIR

if [ -d $FOLDING_DIR ]
then
    cd $FOLDING_DIR
    if [ -e $configfile ]
    then
        stat_runit "Starting folding@home with $configfile"
        exec /opt/fah-v7/FAHClient --config $configfile 2>&1 > /dev/null
    else
        stat_runit "Starting folding@home"

            /opt/fah-v7/FAHClient --run-as mythtv\
                            --team=50975\
                            --user=${foldingusername}\
                            --max-packet-size=${foldingworksize} 2>&1 > /dev/null

    fi
fi