Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !/bin/bash
- PATH=/usr/sbin:/usr/bin:/sbin:/bin
- case $1 in
- config)
- cat <<'EOM'
- graph_category p2pool
- graph_vlabel local p2pool hashrate
- hashrate_dead.label hashrate (if miner perfect)
- hashrate.label hashrate
- graph_title local p2pool hashrate
- EOM
- exit 0;;
- esac
- /usr/bin/wget -q http://happymining.de:7903/local_stats -O /tmp/local_stats.json
- total=0
- total_dead=0
- for code in $(/usr/local/bin/jshon -e miner_hash_rates -k < /tmp/local_stats.json)
- do
- miner=`/usr/local/bin/jshon -Q -e miner_hash_rates -e $code < /tmp/local_stats.json`
- miner_dead=`/usr/local/bin/jshon -Q -e miner_dead_hash_rates -e $code < /tmp/local_stats.json`
- total=`echo "scale=2 ; $miner+$total" | bc`
- if [[ $miner_dead = *[[:digit:]]* ]] ; then
- total_dead=`echo "scale=2 ; $miner_dead+$total_dead" | bc`
- else
- miner_dead=0
- fi
- done
- total_dead=`echo "scale=2 ; $total_dead+$total" | bc`
- echo "hashrate_dead.value" $total_dead
- echo "hashrate.value" $total
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement