Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Run this in the directory where your *.log files are :)
- or ugen.sh | grep -v " 0 hrs"
- For me 192\.168\. matches my solo mining runs/test runs which I ignored for this
- #!/bin/sh
- #
- numbers()
- {
- m2="Runtime:|Pool:|] Average hashrate:"
- egrep "Utility \(accepted shares / min\)|$m2" "$1"
- }
- #
- value()
- {
- echo "$1" | grep "$2" | cut -d':' -f4-
- }
- #
- nums()
- {
- tr -dc "0123456789."
- }
- #
- process()
- {
- data="`numbers "$1" 2> /dev/null`"
- if [ "$data" ] ; then
- haspool="`echo "$data" | grep "Pool:" | grep -v 192\.168\.`"
- if [ "$haspool" ] ; then
- hasrun="`echo "$data" | grep "Runtime:"`"
- if [ "$hasrun" ] ; then
- runtime="`value "$data" Runtime`"
- utility="`value "$data" Utility | nums`"
- hash="`value "$data" hashrate | nums`"
- echo "$1,$runtime,$utility,$hash"
- fi
- fi
- fi
- }
- #
- for i in `ls -rt *.log` ; do
- process "$i"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement