#!/bin/bash
while [ 1 ]; do
echo "<html><head><meta http-equiv=\"refresh\" content=\"5\"/><body>$(aticonfig --adapter=all --odgt | sed ':a;N;$!ba;s/\n/<br\/>/g')<body></html>" | nc -l 9001
done
I realized we have a lot of new Linux users out there, so here's a simple script to keep you away from the GUI.
Put the above in a file, chmod u+x it, run it. That's it. Connect with a browser to whatever the host is, port 9001.
Requires netcat (nc).
Feel free to replace "aticonfig --adapter=all --odgt" with whatever you like - use tee to redirect your miner output or whatever you want to a file, then push that through netcat.
Let's say you've got a script called startminer.sh that starts poclbm (or whatever). You can use the following to start it:
startminer.sh | tee -a minerlog.log
Then use -
#!/bin/bash
while [ 1 ]; do
echo "<html><head><meta http-equiv=\"refresh\" content=\"5\"/><body>$(sed ':a;N;$!ba;s/\n/<br\/>/g' < minerlog.log)<body></html>" | nc -l 9001
done
For ssh sessions, don't forget that happy watch command -
watch -n 1 aticonfig --adapter=all --odgt
Will continuously print to the screen the output from aticonfig every 1 second.
And finally, if you're using eligius, don't forget there are both EU and US servers.
I haven't been able to test the following script... eligius servers haven't gone down. But the idea is if you had a line in your /etc/hosts like:
173.242.112.67 eligius.mining
And pointed a miner at
http://eligius.mining:8337 while the script below ran..... if the hashrate for that server hit 0 or was otherwise unreachable it should "failover" to the other server.
#!/bin/bash
EUHTTP="http://eligius.st/~luke-jr/raw/eu/hashrate.txt"
USHTTP="http://eligius.st/~luke-jr/raw/us/hashrate.txt"
EUIP="85.25.78.8"
USIP="173.242.112.67"
export EUIP
export USIP
CURRENT=$USHTTP
echo $EUIP
echo $USIP
while [ 1 == 1 ]; do
echo "Checking..."
HR=$(wget -q -O - $CURRENT)
if [ -z "$HR" ]
then
HR="0"
fi
echo "Hashrate $HR"
if [ $CURRENT == $USHTTP ]
then
if [ $HR == 0 ]
then
cp /etc/hosts /tmp/hosts
sed s/$USIP/$EUIP/ < /tmp/hosts > /etc/hosts
echo "Switched to Europe."
CURRENT=$EUHTTP
fi
elif [ $CURRENT == $EUHTTP ]
then
if [ $HR == 0 ]
then
cp /etc/hosts /tmp/hosts
sed s/$EUIP/$USIP/ < /tmp/hosts > /etc/hosts
echo "Switched to US."
CURRENT=$USHTTP
fi
fi
sleep 5m
done