From 5c720a987da4fca65889efba4cbc607cf228c10e Mon Sep 17 00:00:00 2001 From: 3err0 Date: Mon, 3 Jun 2019 11:07:46 +0800 Subject: [PATCH] New script --- AntMinerGetAllpool | 20 ++++++++++++++++++++ README.md | 4 +++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100755 AntMinerGetAllpool diff --git a/AntMinerGetAllpool b/AntMinerGetAllpool new file mode 100755 index 0000000..419db08 --- /dev/null +++ b/AntMinerGetAllpool @@ -0,0 +1,20 @@ +#!/bin/bash + +up=`/usr/bin/fping -c1 -t300 $1 &> /dev/null ; echo $?` + +if [ $up = 0 ]; then + +set -o errexit +set -o nounset + +ADDRESS=$1 +PORT=$2 + +pools_raw=`echo '{"command":"pools"}' | nc $ADDRESS $PORT | tr -d '\0\n'` +pools_raw=$(sed 's/}{/\},{/' <<< "$pools_raw") +POOLS=$(jq '.POOLS' <<< "$pools_raw") + +#fan_num=$(jq -r '.[1].fan_num' <<< "$STATS") + +echo $POOLS +fi diff --git a/README.md b/README.md index 496edfb..468ad38 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ **#Antminer scripts (Antminer S9, L3 ...)** -AntMinerGetAllstats - Feech asic JSON information +AntMinerGetAllstats - Feech asic status JSON information + +AntMinerGetAllpool - Feech asic pools JSON information rebootasic - Reboot asic wihtout ssh