Created
January 13, 2022 22:36
-
-
Save markizano/4f48d2a1bb928bf31d30f7c3b2ef443e to your computer and use it in GitHub Desktop.
Watch my miner - stop it when the window opens and resume it when the window closes. I use with `/usr/bin/screen -L`
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
#!/bin/bash | |
export startlog='ZIL PoW Window Start' \ | |
endlog='ZIL PoW Window End' \ | |
minerproc='/usr/local/share/gminer-2.54/miner' \ | |
screenlog=~/screenlog.0 | |
tail -n0 -F "$screenlog" | \ | |
while read logline; do | |
echo "$logline" | grep -qF "$startlog" && { | |
echo "Pausing gminer..."; | |
sudo pkill -u rvn -SIGSTOP -f "$minerproc"; | |
}; | |
echo "$logline" | grep -qF "$endlog" && { | |
echo "Resuming gminer."; | |
sudo pkill -u rvn -SIGCONT -f "$minerproc"; | |
}; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment