This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e | |
| LANG=C | |
| LC_NUMERIC=C | |
| SYMBOLS=("$@") | |
| if ! $(type jq > /dev/null 2>&1); then | |
| echo "'jq' is not in the PATH. (See: https://stedolan.github.io/jq/)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # This bash script is used to login to the antminer, determine hash rate, check if its below a threshold. | |
| # If it is then reboot the miner, email the hashrate and the event. | |
| # Wait 90 seconds (per the antminer docs), email out an uptime to verify that its resumed. | |
| # Using sshpass since my version of antminer wipes all ssh keys upon reboot | |
| # Replace passwords, IP's and email address as needed | |
| # Get the current hash rate | |
| hash_rate=$(sshpass -p "password" ssh -o StrictHostKeyChecking=no root@10.10.10.10 "cgminer-api | grep '\[GHS av\]' | cut -b 16-20") |