#!/bin/bash # # v 0.4 Poolfinder for EthOS rigs (by cYnIxX3) # # USAGE: source <(curl -s http://thecynix.com/pingtime.txt) # # Purpose: This script will compare your pools response time with the top 200 pools # on http://ethosdistro.com/versions you can then use the results to see if you should # consider another pool. echo " ___ _ _____ _ / _ (_)_ __ __ _ /__ (_)_ __ ___ ___ / /_)/ | '_ \\ / \` | / /\\/ | '_ \` _ \\ / _ \\ / ___/| | | | | (_| | / / | | | | | | | __/ \\/ |_|_| |_|\\__, | \\/ |_|_| |_| |_|\\___| |___/ Starting to ping the pools . . . 10 seconds remain" # Read config and ping current pools if [ -e /opt/ethos/sbin/ethos-readconf ] ; then proxypool1=$(/opt/ethos/sbin/ethos-readconf proxypool1 | cut -d : -f 1) proxypool2=$(/opt/ethos/sbin/ethos-readconf proxypool2 | cut -d : -f 1) proxypool1ping=$(ping -c 2 -W 2 -w 4 "$proxypool1" 2>/dev/null | grep rtt | cut -d / -f 5) proxypool2ping=$(ping -c 2 -W 2 -w 4 "$proxypool2" 2>/dev/null | grep rtt | cut -d / -f 5) fi touch /tmp/ping.txt # Check website for a pool list mapfile -t pools < <(curl -s http://ethosdistro.com/versions/ | awk 'c&&c--;/Pools/dev/null | grep rtt | cut -d / -f 5)" "${qtys[l]}" "${pools[l]}" 1>>/tmp/ping.txt & disown $! ((l++)) done sleep 3 # If run on an EthOS rig then display configured pools and times if [ -e /opt/ethos/sbin/ethos-readconf ] ; then printf 'Your pools are %s @ %5.5sms' "$proxypool1" "$proxypool1ping" if [ "$proxypool2" != "" ] ; then printf ' and %s @ %5.5sms' "$proxypool2" "$proxypool2ping" ; fi echo "." fi # Show the list of pools under 100ms out=$(awk -F' ' 'NF==3 {if($1==$1+0 && $1<100)print}' /tmp/ping.txt | sort -n) if [ "$out" == "" ] ; then out=$(awk -F' ' 'NF==3 {if($1==$1+0 && $1<250)print}' /tmp/ping.txt | sort -n) echo "WARNING: Unable to find pools under the recommended 100ms response time - recalculating for pools under 250ms" elif [ "$out" == "" ] ; then out=$(awk -F' ' 'NF==3 {if($1==$1+0 && $1<1000)print}' /tmp/ping.txt | sort -n) echo "ERROR: Unable to find pools under 250ms for mining on your connection. Please look for a lower latency internet connection to avoid stale shares - recalculating for pools under 1,000ms" elif [ "$out" == "" ] ; then echo "FAILURE: Unable to communicate with a pool in under a second, maybe you are unable to ping over your network." else printf 'EthOS compatible pool listing\nPing ms - #Rigs - Pool address\n%s\n' "$out" fi rm /tmp/ping.txt