summaryrefslogtreecommitdiffstats
path: root/abs/extra-testing/community/foldingathome/foldingathome.install
blob: 3ecc7c983fa4954d5381d934f257a1682b1ac7e1 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
post_install() {
  # Check for an R5.5 fah installation.
  r5_fah_dir=/myth/folding@home
  r6_fah_dir=/myth/folding_$(hostname)
  if [ -d "$r5_fah_dir" ] ; then
    if [ -d "$r6_fah_dir" ] ; then
      cat << 'EOM'
  --> You have an R5.5 and an R6 folding directory at the same time!
  --> you should manually delete the R5.5 directory:
  -->    $r5_fah_dir
EOM
    else
      mv $r5_fah_dir $r6_fah_dir
    fi
  else
    if [ ! -d "$r6_fah_dir" ] ; then
      mkdir $r6_fah_dir
      cat > $r6_fah_dir/client.cfg << 'EOM'
[settings]
username=LinHES
team=50975
passkey=
asknet=no
bigpackets=normal
machineid=1

[http]
active=no
host=localhost
port=8080
EOM
    fi
  fi

  /sbin/add_service.sh fah
  sleep 5
  /sbin/sv -v start fah
}

pre_remove() {
  /sbin/sv stop fah
  /sbin/remove_service.sh fah
}