File: foldingathome.in

package info (click to toggle)
munin 2.0.76-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,068 kB
  • sloc: perl: 11,684; java: 1,924; sh: 1,632; makefile: 636; javascript: 365; python: 267
file content (39 lines) | stat: -rw-r--r-- 838 bytes parent folder | download | duplicates (6)
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
#!@@GOODSH@@
# -*- sh -*-
#
# Folding@Home
#
# Parameters:
#
#   config   (required)
#   autoconf (optional - only used by munin-config)
#
# Magic markers (optional - used by munin-config and some installation
# scripts):
#%# family=contrib
#%# capabilities=autoconf

FOLDING_PATH=/usr/local/fah
data_filename=$FOLDING_PATH/${file:-unitinfo.txt}

if [ "$1" = "autoconf" ]; then
    if [ -r "$data_filename" ]; then
        echo yes
    else
        echo "no (F@H file '$data_filename' not found)"
    fi
    exit 0
fi

if [ "$1" = "config" ]; then

    echo 'graph_title Folding@Home'
    echo 'graph_args -l 0 --base 1000'
    echo 'graph_vlabel % finished'
    echo 'done.label done folding'
    echo 'done.type GAUGE'
    echo 'done.max 100'
    exit 0
fi

grep "Progress" "$data_filename" | /bin/sed 's/^.*: \(.*\)%.*/done.value \1/'