-
Notifications
You must be signed in to change notification settings - Fork 5
/
ETHminerWatchDogDmW.sh
124 lines (89 loc) · 3.06 KB
/
ETHminerWatchDogDmW.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash
#========== Run EthMiner Command ==========
RunEthMinerCommand()
{
#==================== Your Code Starts Here ====================
#==================== Your Code Starts Here ====================
#==================== Your Code Starts Here ====================
./ethminer --farm-recheck 6000 -R --display-interval 10 --exit -X -P stratum1+tcp://0x0x0a42cE58f6f42516d8cc7B1831d01d4391F59Ef4.ETHminerWatchDogDmW@eu1.ethermine.org:4444 -P stratum1+tcp://0x0a42cE58f6f42516d8cc7B1831d01d4391F59Ef4.ETHminerWatchDogDmW@eu1.ethermine.org:14444
#==================== Your Code Ends Here ====================
#==================== Your Code Ends Here ====================
#==================== Your Code Ends Here ====================
}
#========== PreStart ==========
#Set EthMiner Variables
export GPU_FORCE_64BIT_PTR=0
export GPU_MAX_HEAP_SIZE=100
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100
export GPU_SINGLE_ALLOC_PERCENT=100
export CUDA_DEVICE_ORDER=PCI_BUS_ID
#export NO_COLOR=Yes
#Set version info
V=1.9.8
#========== Start ==========
clear
echo '###############################################################################'
echo #
echo ' ETHminerWatchDogDmW Version '$V
echo #
echo ' AUTHOR: DeadManWalking (DeadManWalkingTO-GitHub)'
echo #
echo '###############################################################################'
echo #
echo 'ETHminerWatchDogDmW'
echo '1. Run ethminer.'
echo '2. Restart ethminer up to 10 times.'
echo '3. Reboot the system.'
echo #
echo 'Additional:'
echo '- Log file RunTimes.log'
echo #
#========== Initializing ==========
loopnum=$((0))
FileOut=RunTimes.log
echo 'ETHminerWatchDogDmW Version '$V >> $FileOut
#========== Run Program ==========
while [ $loopnum -le 9 ]
do
#========== Calc ==========
#Increment loop by one
loopnum=$((loopnum+1))
#Calculate Date & Time
pISOdate=`date '+%Y-%m-%d %H:%M'`
#========== Screen Output ==========
echo #
echo '==============================================================================='
echo $pISOdate
echo 'ETHminerWatchDogDmW has run '$loopnum' times.'
echo '==============================================================================='
echo #
#========== File Output ==========
echo $pISOdate ETHminerWatchDogDmW has run $loopnum times.>>$FileOut
#========== Execution Code ==========
RunEthMinerCommand
#Wait 5s
sleep 5s
done
#========== Error Handling ==========
#========== Error Screen Output ==========
echo
echo '==============================================================================='
echo $pISOdate
echo 'ETHminerWatchDogDmW has run '$loopnum' times.'
echo 'System restart required.'
echo
echo
echo
echo 'Rebooting now ('$pISOdate').'
echo '###############################################################################'
echo
#========== Error File Output ==========
echo $pISOdate' ETHminerWatchDogDmW has run '$loopnum' times.'>>$FileOut
echo 'System restart required. Rebooting now ('$pISOdate').'>>$FileOut
echo >>$FileOut
echo >>$FileOut
#========== System Reboot ==========
shutdown -r now
#========== End ==========
#========== EoF ==========