Last active
December 26, 2015 04:39
-
-
Save ryanzabcik/7095256 to your computer and use it in GitHub Desktop.
This script runs cudaminer only if the main display :0 is off. Uses polling every ~10 seconds.
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/sh | |
export DISPLAY=:0 | |
while true; do | |
# check to see if cudaminer is still alive, (possibly stopped) | |
if pgrep cudaminer; then | |
#if the monitor is on | |
if xset -q | grep -q 'Monitor is On'; then | |
pkill -STP cudaminer | |
else | |
pkill -CONT cudaminer | |
fi | |
else | |
nohup cudaminer # user-specific arguments | |
fi | |
# poll every 10 seconds | |
sleep 10 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment