moved from there
https://bitcointalksearch.org/topic/m.28619062tips are welcome BTC/BCH: 1JpmzRLXErkhVU11TUe9Ee4nS1zv77tF7b ETH: 0x6d8fc552f832f69D1EBf236A56F196C176aD5cf5
happen to u that u got tired to setup each miner in ur small/medium farm ? if yes this script is for u.
in short u wont need to enter the web application of each miner and configure them one by one. its tiring and not so fun when u have 10 20 30 50 miners.
i made a little script that will save u A lot of time.
u configure the script ones as u wish , and then run it, it take 5 seconds to configure ur miner (really only 5 sec)
so here is my first script. explanation below
https://pastebin.com/SeMJwsRP#!/bin/sh
#https://bitcointalk.org/index.php?topic=2799605.msg
cp /config/bmminer.conf /config/bmminer.conf.backup
cp /config/network.conf /config/network.conf.backup
rm /config/bmminer.conf
rm /config/network.conf
touch /config/bmminer.conf
touch /config/network.conf
echo "{" >> /config/bmminer.conf
echo "\"pools\" : [" >> /config/bmminer.conf
echo "{" >> /config/bmminer.conf
echo "\"url\" : \"stratum.antpool.com:3333\"," >> /config/bmminer.conf
echo "\"user\" : \"test.$1\"," >> /config/bmminer.conf
echo "\"pass\" : \"123\"" >> /config/bmminer.conf
echo "}," >> /config/bmminer.conf
echo "{" >> /config/bmminer.conf
echo "\"url\" : \"stratum.antpool.com:3333\"," >> /config/bmminer.conf
echo "\"user\" : \"test.$2\"," >> /config/bmminer.conf
echo "\"pass\" : \"123\"" >> /config/bmminer.conf
echo "}," >> /config/bmminer.conf
echo "{" >> /config/bmminer.conf
echo "\"url\" : \"stratum.antpool.com:3333\"," >> /config/bmminer.conf
echo "\"user\" : \"test.$3\"," >> /config/bmminer.conf
echo "\"pass\" : \"123\"" >> /config/bmminer.conf
echo "}" >> /config/bmminer.conf
echo "]" >> /config/bmminer.conf
echo "," >> /config/bmminer.conf
echo "\"api-listen\" : "true"," >> /config/bmminer.conf
echo "\"api-network\" : "true"," >> /config/bmminer.conf
echo "\"api-groups\" : \"A:stats:pools:devs:summary:version\"," >> /config/bmminer.conf
echo "\"api-allow\" : \"A:0/0,W:*\"," >> /config/bmminer.conf
echo "\"bitmain-use-vil\" : "true"," >> /config/bmminer.conf
echo "\"bitmain-freq\" : \"550\"," >> /config/bmminer.conf
echo "\"bitmain-voltage\" : \"0706\"," >> /config/bmminer.conf
echo "\"multi-version\" : \"1\"" >> /config/bmminer.conf
echo "}" >> /config/bmminer.conf
chmod 400 /config/bmminer.conf
echo "hostname=miner$4" >> /config/network.conf
echo "ipaddress=10.0.0.$5" >> /config/network.conf
echo "netmask=255.255.255.0" >> /config/network.conf
echo "gateway=10.0.0.138" >> /config/network.conf
echo "dnsservers=\"8.8.8.8"\" >> /config/network.conf
chmod 400 /config/network.conf
#/etc/init.d/bmminer.sh restart >/dev/null 2>&1
#/etc/init.d/network.sh
#/etc/init.d/avahi restart > /dev/null
#echo "root:antMiner Configuration:23c2a2d78c0d20ec069097d7d20c4392" >> /config/lighttpd-htdigest.user
ssh into ur miner
create a bash file and put the script inside or move it with scp/winscp
give it root permission to edit the files. with chmod 7777 filename.sh
u will need to do some manual modification at start.
u should manual change everything that static that should not change.
for example , pools,netmask,getway,dnsserver, the start of the miner name(hostname) and the start of the ip and the workername.
make sure u have backed up ur settings before if anything goes bad. and u can factory reset
https://enforum.bitmain.com/bbs/topics/3957running the script will be
sh filename.sh 1 2 3 4 5
1, is the first worker name
2, is the second worker name
3, is the third worker name
4, hostname
5, ip address.
please notice that the workername will be only the end of it. which mean useraccount.
workernamehere, in the script its test.$1 (test = useraccount $1=workername)
if u want to change the password just uncomment the last line and put ur password instead. u can use
http://www.md5.cz/ to generate a hash "password" for u.
root:antMiner Configuration:passwordhere = dad8edbc0681a4c03057417c19239983 =
root:antMiner Configuration:dad8edbc0681a4c03057417c19239983 < u put this in the script
before uncomment
#/etc/init.d/bmminer.sh restart >/dev/null 2>&1
#/etc/init.d/network.sh
#/etc/init.d/avahi restart > /dev/null
please DO check the files if they are ok.
it should look like this.
/config/bmminer.conf
{
"pools" : [
{
"url" : "solo.antpool.com:3333",
"user" : "test.1",
"pass" : "123"
},
{
"url" : "stratum.antpool.com:443",
"user" : "test.1",
"pass" : "123"
},
{
"url" : "stratum+tcp://cn.ss.btc.com:3333",
"user" : "test",
"pass" : "123"
}
]
,
"api-listen" : true,
"api-network" : true,
"api-groups" : "A:stats:pools:devs:summary:version",
"api-allow" : "A:0/0,W:*",
"bitmain-use-vil" : true,
"bitmain-freq" : "550",
"bitmain-voltage" : "0706",
"multi-version" : "1"
}
/config/network.conf
hostname=miner1
ipaddress=10.0.0.1
netmask=255.255.255.0
gateway=10.0.0.200
dnsservers="8.8.8.8"
after checking the files is right. uncomment these 3 commands
will apply the pools settings
/etc/init.d/bmminer.sh restart >/dev/null 2>&1
and this will apply hostname and ip settings.
/etc/init.d/network.sh
/etc/init.d/avahi restart > /dev/null
for a real example that will be
sh script.sh m1 m1 m1 1 1
the result will be
first pool second pool third pool hostname IP
test.m1 test.m1 test.m1 miner1 10.0.0.1
if u need any help, or u want to report a bug please tell me.
or want to help to make it better welcome ur self to edit and share it
tips are welcome BTC/BCH: 1JpmzRLXErkhVU11TUe9Ee4nS1zv77tF7b ETH: 0x6d8fc552f832f69D1EBf236A56F196C176aD5cf5