1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-11-22 12:54:04 +02:00
openwrt-packages/cgminer/files/cgminer-monitor

19 lines
363 B
Plaintext
Raw Permalink Normal View History

#!/bin/sh
# This file is for cron job
2013-03-02 11:24:35 +02:00
C=`pidof cgminer | wc -w`
if [ "$C" != "1" ]; then
/etc/init.d/cgminer stop
/etc/init.d/cgminer start
exit 0;
fi
A=`cat /tmp/cm.log`
B=`cgminer-api | grep "^ \[Accepted\]"`
cgminer-api | grep "^ \[Accepted\]" > /tmp/cm.log
if [ "$A" == "$B" ]; then
/etc/init.d/cgminer stop
/etc/init.d/cgminer start
exit 0;
fi