-
Notifications
You must be signed in to change notification settings - Fork 23
/
0cpuminer
114 lines (91 loc) · 2.63 KB
/
0cpuminer
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
#!/bin/bash
##########################################################################
##########################################################################
#################### nvOC 3.2 - Community Release ####################
########## Based on the original nvOC v0019-1.4 by fullzero ##########
##########################################################################
##########################################################################
# 0cpuminer for nvOC v0019
# DEV Mod Log:
# v=0001 : LuKePicci
# Initial Release
nvOC_0cpuminer_dev="0001"
source "${NVOC}/1bash"
nvOC_0cpuminer_ver="$nvOC_Ver.$nvOC_0cpuminer_dev" # Do not edit this
# Prevent running 2 miners
if ps ax | grep SCREEN | grep -q cpuminer
then
ps ax | grep SCREEN | grep cpuminer | awk '"cpuminer" {print $1}' | xargs kill -9
fi
# Set MINER_PWD if unset
if [ -z "${MINER_PWD+x}" ]
then
MINER_PWD="x"
fi
## Unify Start
UPOOL="_POOL"
UPORT="_PORT"
UPROTO="_POOL_PROTOCOL"
UADDR="_ADDRESS"
UWORK="_WORKER"
UCOINOPTS="_OPTS"
UINTENSITY="_INTENSITY"
UWALLET="_WALLET_FORMAT"
UMINER="_MINER"
UFEE="_FEE"
UVERSION="_VERSION"
PLUSCPU="plusCPU"
xpool=$PLUSCPU$UPOOL
xport=$PLUSCPU$UPORT
xproto=$PLUSCPU$UPROTO
xaddr=$PLUSCPU$UADDR
xwork=$PLUSCPU$UWORK
xcoinopts=$PLUSCPU$UCOINOPTS
xintensity=$PLUSCPU$UINTENSITY
xwallet=$PLUSCPU$UWALLET
xminer=$PLUSCPU$UMINER
xfee=${!xminer}$UFEE
xversion=${!xminer}$UVERSION
## Unify End
UCCALGO="-a ${ALGO,,}"
UCCCOIN="${COIN,,}"
OPTS="${!xcoinopts} $(dgh_get_miner_opts "${!xminer}" "$COIN" "$ALGO")"
mpath="${NVOC}/miners/${!xminer}"
LAUNCH="screen -c ${NVOC}/screenrc-cpuminer -dmSL cpuminer"
if [[ ${!xaddr} == "" ]]
then
echo "WARNING: ${xaddr} is empty or not set"
fi
if [[ ${!xproto} == "" ]]
then
eval $xproto="stratum+tcp"
fi
if [[ ${!xversion} == "" ]]
then
eval $xversion="recommended"
fi
## Pluggable miners
if [[ ${!xversion} != "" && -f ${mpath}/"${!xversion}"/nvoc-miner.json || -f ${mpath}/nvoc-miner.json ]]
then
pm_manifest=${mpath}/${!xversion}/nvoc-miner.json
if [[ $FOREMAN_MONITOR == YES ]]
then
# parse foreman monitor params
api_ext=$(jq -r .foreman.api_ext ${pm_manifest})
if [[ $api_ext != "" ]]
then
OPTS="$OPTS $api_ext"
fi
fi
HCD="${mpath}/"${!xversion}"/$(jq -r .cpuminer.hcd ${pm_manifest})"
eval echo $LAUNCH $HCD $OPTS
eval $LAUNCH $HCD $OPTS
elif [[ ${!xminer} == cpuOPT ]]
then
HCD="${NVOC}/miners/cpuOPT/cpuminer -o stratum+tcp://${!xpool}:${!xport} -u ${!xaddr}${!xwallet}${!xwork} -p ${MINER_PWD} -t $threadCOUNT ${!xext}"
eval $LAUNCH $HCD
else
echo ""
echo "Can't find cpuminer '${!xminer}', Check your settings"
echo "CPU miner not started."
fi