-
Notifications
You must be signed in to change notification settings - Fork 6
/
entrypoint.sh
executable file
·86 lines (76 loc) · 1.93 KB
/
entrypoint.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
#!/bin/sh
sysctl vm.nr_hugepages=128
if [ -z "$numthreads" ]; then
echo "\$numthreads is empty"
numthreads=$(expr $(nproc) / 2)
else
echo "\$numthreads is NOT empty"
fi
echo " Using --- $numthreads"
if [ -z "$startport" ] ;then
echo "\$startport is empty"
startport=3333
else
echo "\$startport is NOT empty"
fi
echo " Using --- $startport"
if [ -z "$xmrpool" ]; then
echo "\$xmrpool is empty"
xmrpool=stratum+tcp://pool.supportxmr.com
else
echo "\$xmrpool is NOT empty"
fi
echo " Using --- $xmrpool"
if [ -z "$password" ]; then
echo "\$password is empty"
password=docker
echo " Using --- $password"
else
echo "\$password is NOT empty"
fi
if [ -z "$donate" ]; then
echo "\$donate is empty"
donate=5
else
echo "\$donate is NOT empty"
fi
echo " Using --- $donate"
if [ -z "$algo" ]; then
echo "\$algo is empty"
if [ -z "$coin" ]; then
echo "\$coin is empty"
coin=monero
else
echo "\$coin is NOT empty"
fi
else
echo "\$algo is NOT empty"
fi
if [ -z "$algo" ]; then echo " Using --- $coin"; else echo " Using --- $algo"; fi
git clone https://github.com/xmrig/xmrig.git --depth 1
cd xmrig
git checkout v$VERSION
sed -i -e 's/constexpr const int kMinimumDonateLevel = 1;/constexpr const int kMinimumDonateLevel = 0;/g' src/donate.h
mkdir build
cd build
cmake ..
make -j$(nproc)
if [ -z "$algo" ]; then
echo -o $xmrpool:$startport -u $username -p $password -t $numthreads --coin=$coin --donate-level=$donate $OPTIONS
./xmrig -o $xmrpool:$startport \
-u $username \
-p $password \
-t $numthreads \
--coin=$coin \
--donate-level=$donate \
$OPTIONS
else
echo -o $xmrpool:$startport -u $username -p $password -t $numthreads --algo=$algo --donate-level=$donate $OPTIONS
./xmrig -o $xmrpool:$startport \
-u $username \
-p $password \
-t $numthreads \
--algo=$algo \
--donate-level=$donate \
$OPTIONS
fi