cgminer-gekko-monitor 581 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. # This file is for cron job
  3. # Make sure there is only one cgminer running
  4. C=`pidof cgminer | wc -w`
  5. if [ "$C" != "1" ]; then
  6. killall -s 9 cgminer
  7. sleep 1
  8. /etc/init.d/cgminer restart
  9. exit 0;
  10. fi
  11. # Make sure the devices staill active
  12. B=`cgminer-api devs | grep "^ \[Last Valid Work\]"`
  13. if [ "$?" != "0" ]; then
  14. killall -s 9 cgminer
  15. sleep 1
  16. /etc/init.d/cgminer restart
  17. exit 0;
  18. fi
  19. A=`cat /tmp/cm.log`
  20. echo -n "$B" > /tmp/cm.log
  21. if [ "$A" == "$B" ]; then
  22. killall -s 9 cgminer
  23. sleep 1
  24. /etc/init.d/cgminer restart
  25. exit 0;
  26. fi