1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-12-23 03:53:20 +02:00
openwrt-packages/cgminer/files/cgminer-monitor
2013-03-06 17:23:40 +08:00

19 lines
363 B
Bash
Executable File

#!/bin/sh
# This file is for cron job
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