-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinit.sh
40 lines (31 loc) · 784 Bytes
/
init.sh
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
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
if [ ! -z "$FOLD_USER" ]; then
export FOLD_ANON=false
fi
cat <<EOF | tee /etc/fahclient/config.xml
<config>
<!-- Client Control -->
<fold-anon v='$FOLD_ANON'/>
<!-- Folding Slot Configuration -->
<gpu v='false'/>
<!-- HTTP Server -->
<allow v='127.0.0.1 $FOLD_ALLOW_IP'/>
<!-- Slot Control -->
<power v='$FOLD_POWER'/>
<!-- User Information -->
<passkey v='$FOLD_PASSKEY'/>
<user v='$FOLD_USER'/>
<team v='$FOLD_TEAM'/>
<!-- Web Server -->
<web-allow v='127.0.0.1 $FOLD_ALLOW_IP'/>
<!-- Folding Slots -->
<slot id='0' type='CPU'/>
</config>
EOF
# Kick start folding service
/etc/init.d/FAHClient start 2> /dev/null
while [ ! -f /var/lib/fahclient/log.txt ]
do
sleep 2 # or less like 0.2
done
tail -f /var/lib/fahclient/log.txt