Created
February 21, 2017 03:19
-
-
Save bitlewis/49c94e84e046f0a837f6cdaaa8174021 to your computer and use it in GitHub Desktop.
ethos-clocks-generator
This file contains 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/php -q | |
# // Script to auto reboot rigs with stuck_miners condition | |
<?php | |
$ethosurl = "http://hashr9.ethosdistro.com/?json=yes"; | |
$json6 = file_get_contents($ethosurl); | |
$ethosjson = json_decode($json6); | |
foreach($ethosjson->rigs as $rig_id => $k) { | |
if(is_array($ethosjson->rigs) || is_object($ethosjson->rigs)) { | |
$gpubioses = explode(" ", $k->bioses); | |
$totalgpu = count($gpubioses); | |
$counter = "0"; | |
echo '#', $k->rack_loc, PHP_EOL; | |
echo 'mem ', $rig_id; | |
echo ' 1900 '; | |
if(is_array($gpubioses) || is_object($gpubioses)) { | |
foreach($gpubioses as $gpuid => $bios){ | |
$counter++; | |
if($counter > "1") { | |
if($bios == "113-1E3471U.O4Y") { | |
echo "1950"; | |
} elseif($bios == "113-1E3471U.O5O") { | |
echo "1940"; | |
} elseif($bios == "113-1E3471U.O6D") { | |
echo "2000"; | |
} | |
if($counter != $totalgpu) { | |
echo ' '; | |
} | |
} | |
} | |
} | |
echo PHP_EOL; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment