New script
This commit is contained in:
Executable
+20
@@ -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
|
||||
Reference in New Issue
Block a user