Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- sleep 10
- prevUrl=-1
- url=0
- # enter main loop
- while true; do
- result=`curl --fail --silent -X POST -H "Content-Type: application/json" -d '{"algos": {"x11": {"hashrate": 150000000},"x13": {"hashrate": 150000000},"x14": {"hashrate": 150000000},"x15": {"hashrate": 150000000},"quark": {"hashrate":150000000},"qubit": {"hashrate":150000000}}, "region": "eu", "name": "A01"}' 'http://10.1.0.49:8081/api/query' | jq '.result'`
- algo=`echo $result | jq -r '.algo'`
- url=`echo $result | jq -r '.url'`
- if [ "$url" != "" ] && [ "$url" != "$prevUrl" ]; then
- # new algo, change conf and restart miner
- echo "switching to $algo"
- curl -X GET -H "Content-Type: application/json" -G -i -d 'pools=[{"url":"'"$url"'","pass":"x","priority":"10","algo":"'"$algo"'","user":"12gotm1HbU1zv9FMnuNfPakpn7rsRjB1no.A01"}]' "http://localhost/f_settings.php"
- prevUrl="$url"
- fi
- sleep 5m
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement