Skip to content

Instantly share code, notes, and snippets.

@frdmn
Last active January 1, 2016 04:49
Show Gist options
  • Save frdmn/8094294 to your computer and use it in GitHub Desktop.
Save frdmn/8094294 to your computer and use it in GitHub Desktop.
Simple bash script to get the latest Informations of your Altcoin Mining workers based on the MPOS API (which is probably used by 95% of the pools out there)
#!/bin/bash
# MPOS Hostname
config_host="miningpool.org"
# MPOS API token (Login -> Edit Account -> API Key)
config_api="0123456789abcdefghijklmnopqrstuvwxyzaaabacadaeafagahaiajakalaman"
json=$(curl -s "http://${config_host}/index.php?page=api&action=getuserstatus&api_key=${config_api}" | python -m json.tool)
parse_hashrate=$(echo "$json" | python -m json.tool | grep "hashrate" | awk '{ print $2 }' | sed 's/,//g')
parse_sharerate=$(echo "$json" | python -m json.tool | grep "sharerate" | awk '{ print $2 }' | sed 's/,//g' | sed 's/"//g')
parse_shares_valid=$(echo "$json" | python -m json.tool | grep "\"valid" | awk '{ print $2 }' | sed 's/,//g')
parse_shares_invalid=$(echo "$json" | python -m json.tool | grep "invalid" | awk '{ print $2 }'| sed 's/,//g')
parse_credit_confirmed=$(echo "$json" | python -m json.tool | grep "Credit" | awk '{ print $2 }' | sed 's/,//g')
parse_credit_fee=$(echo $json | python -m json.tool | grep "\"Fee" | awk '{ print $2 }' | sed 's/,//g')
parse_credit_txfee=$(echo $json | python -m json.tool | grep "TXFee" | awk '{ print $2 }' | sed 's/,//g')
echo "Hashrate: ${parse_hashrate} kh/s"
echo "Shares: ${parse_shares_invalid} / ${parse_shares_valid} invalid"
echo "Sharerate: ${parse_sharerate}"
echo "Credit: ${parse_credit_confirmed} ($(echo ${parse_credit_fee}+${parse_credit_txfee}|bc) Fee)"

MPOS poolinfo

Simple bash script to get the latest Informations of your Altcoin Mining workers based on the MPOS API (which is probably used by 95% of the pools out there).

Installation

wget https://gist.github.com/frdmn/8094294/raw/mininginfo -O /usr/bin/mininginfo
chmod +x /usr/bin/mininginfo
sed -i 's/miningpool.org/<YOUR_POOL_HOST>/g' /usr/bin/mininginfo
sed -i 's/0123456789abcdefghijklmnopqrstuvwxyzaaabacadaeafagahaiajakalaman/<YOUR_API_TOKEN>/g' /usr/bin/mininginfo
mininginfo

Screenshot / Demo

mininginfo screenshot

root@miner:~# mininginfo
Hashrate: 133 kh/s
Shares: 0 / 200 invalid
Sharerate: 0.0317
Credit: 917.98932118 (9.17989321 Fee)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment