-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathS17plus.sh
67 lines (58 loc) · 1.95 KB
/
S17plus.sh
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
#############################################
# VARIABLE
#
ADDRESS=$1
PORT=80
username=root
password=root
_ant_pool1=sfarm1.btc.sigmapool.com:3333
_ant_pool2=sfarm2.btc.sigmapool.com:3333
_ant_pool3=ru1.btc.sigmapool.com:3333
_ant_pool1=$(jq -nr --arg v "$_ant_pool1" '$v|@uri')
_ant_pool2=$(jq -nr --arg v "$_ant_pool2" '$v|@uri')
_ant_pool3=$(jq -nr --arg v "$_ant_pool3" '$v|@uri')
echo ${_ant_pool1}
_ant_pool1user=$2.0000
_ant_pool1pw=123
_ant_pool2user=$2.0000
_ant_pool1pw=123
_ant_pool3user=$2.0000
_ant_pool1pw=123
COUNTER=1
#################
# PROGRAMM
#
while read line
do
li=$(echo $line|tr -d '\n')
li2=$(echo $li|tr -d ' ')
if [ ${#line} -lt 2 ]
then
continue
fi
#-# ping -c 2 -- $li2>>/dev/null
ADDRESS=$li2
echo ' $ADDRESS = '$ADDRESS
echo ' $COUNTER = '$COUNTER
COUNTER=$(printf "%0004d" $COUNTER)
_ant_pool1user=$2.${COUNTER}
_ant_pool2user=${_ant_pool1user}
_ant_pool3user=${_ant_pool2user}
######################################
# CURL POST
#
RET=$(curl --max-time 2 -s "http://$ADDRESS:$PORT/cgi-bin/set_miner_conf.cgi" -H 'Authorization: Digest username="'$username'", realm="antMiner Configuration", nonce="7d9c8566fed24a4148b8b7a362c8cdf1", uri="/cgi-bin/set_miner_conf.cgi", response="aae9ffc8dd0762c8e8e8ea9f5899e174", qop=auth, nc=00000017, cnonce="d8042e5d610f4cdd"' --data "_ant_pool1url=${_ant_pool1}&_ant_pool1user=${_ant_pool1user}&_ant_pool1pw=${_ant_pool1pw}&_ant_pool2url=${_ant_pool2}&_ant_pool2user=${_ant_pool2user}&_ant_pool2pw=${_ant_pool1pw}&_ant_pool3url=${_ant_pool3}&_ant_pool3user=${_ant_pool3user}&_ant_pool3pw=${_ant_pool1pw}&_ant_nobeeper=false&_ant_notempoverctrl=false&_ant_fan_customize_switch=false&_ant_fan_customize_value=&_ant_freq=&_ant_voltage=1950" --compressed)
#'
echo $RET
COUNTER=`expr $COUNTER + 1`
#echo '$COUNTER = '$COUNTER
#echo '$_ant_pool1user = '$_ant_pool1user
##########################################
if [ $? -gt 0 ]
then
echo 'bad'
else
echo 'good'
fi
done<$1