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 45 46 47 48 49 50 51 52 53
|
#!/bin/sh
#
# Folding@Home
#
# Parameters:
#
# config (required)
# autoconf (optional - only used by munin-config)
#
# $Log$
# Revision 1.1 2004/12/09 16:49:30 jimmyo
# Renamed generic/folding@home to generic/foldingathome (SF#1074241).
#
# Revision 1.2 2004/05/09 19:47:24 jimmyo
# Added Folding@home plugin, contributed by Xavier.
#
#
# Magic markers (optional - used by munin-config and some installation
# scripts):
#%# family=contrib
#%# capabilities=autoconf
PATH=/usr/local/fah
FILE=${file:=unitinfo.txt}
if [ "$1" = "autoconf" ]; then
if ( cat $PATH/$FILE 2>/dev/null >/dev/null ); then
echo yes
exit 0
else
if [ $? -eq 127 ]
then
echo "no (F@H not found)"
exit 1
else
echo no
exit 1
fi
fi
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
echo `/bin/grep "Progress" $PATH/$FILE | /bin/sed 's/^.*: \(.*\)%.*/done.value \1/'`
|