git.iko.soy/xmrig-bash-scripts
on master help sign in
pre testing
commitc8bf4ae63ca3b0a8fb6212753a57b48c7890366a authorSean Wheller <sean@prepaidmeters.com> dateSat 27 Jul 2019, 21:04 (7 years ago) parentfb7ccf8
4 files changed+125−105
config.json+51−104 config.sh+72 depends.sh+1−1 start.sh+1
config.json+51−104
@@ -1,105 +1,52 @@
11{
2− "api": {
3− "id": null,
4− "worker-id": "sean-wks"
5− },
6− "autosave": true,
7− "background": false,
8− "colors": true,
9− "cpu": {
10− "enabled": true,
11− "huge-pages": true,
12− "hw-aes": null,
13− "priority": null,
14− "asm": true,
15− "cn": [
16− -1,
17− -1,
18− -1,
19− -1
20− ],
21− "cn-heavy": [
22− -1,
23− -1
24− ],
25− "cn-lite": [
26− -1,
27− -1,
28− -1,
29− -1,
30− -1,
31− -1,
32− -1,
33− -1
34− ],
35− "cn-pico": [
36− -1,
37− -1,
38− -1,
39− -1,
40− -1,
41− -1,
42− -1,
43− -1
44− ],
45− "cn/gpu": [
46− -1,
47− -1,
48− -1,
49− -1,
50− -1,
51− -1,
52− -1,
53− -1
54− ],
55− "rx": [
56− -1,
57− -1,
58− -1,
59− -1
60− ],
61− "rx/wow": [
62− -1,
63− -1,
64− -1,
65− -1,
66− -1,
67− -1,
68− -1,
69− -1
70− ],
71− "cn/0": false,
72− "cn-lite/0": false
73− },
74− "donate-level": 5,
75− "donate-over-proxy": 1,
76− "http": {
77− "enabled": false,
78− "host": "127.0.0.1",
79− "port": 0,
80− "access-token": null,
81− "restricted": true
82− },
83− "log-file": null,
84− "pools": [
85− {
86− "algo": null,
87− "url": "192.168.4.5:3333",
88− "user": "854sqm2Cm4TB2XgPHWqSPSbnFAe3SMzdEDzZHpukQ8NHBPFropbnkFmEKiZPgwjMFC9PTjaFscR2UU6ZwFCqJzGMUiZVbTM",
89− "pass": "sean-wks:miners@prepaidmeters.com",
90− "rig-id": "sean-wks",
91− "nicehash": true,
92− "keepalive": true,
93− "enabled": true,
94− "tls": false,
95− "tls-fingerprint": null,
96− "daemon": false
97− }
98− ],
99− "print-time": 30,
100− "retries": 5,
101− "retry-pause": 5,
102− "syslog": false,
103− "user-agent": null,
104− "watch": true
105−}
2+ "api": "{",
3+ "autosave": "true",
4+ "background": "false",
5+ "colors": "true",
6+ "cpu": {
7+ "enabled": true,
8+ "huge-pages": true,
9+ "hw-aes": null,
10+ "priority": null,
11+ "asm": true,
12+ "cn": [
13+ 0,
14+ 1,
15+ 2,
16+ 3
17+ ],
18+ "cn/0": false,
19+ "cn-lite/0": false
20+ },
21+ "donate-level": 5,
22+ "donate-over-proxy": 1,
23+ "http": {
24+ "enabled": true,
25+ "host": "192.168.10.93",
26+ "port": 8080,
27+ "access-token": null,
28+ "restricted": false
29+ },
30+ "logfile": null,
31+ "pools": [
32+ {
33+ "algo": "cn",
34+ "url": "192.168.4.5:3333",
35+ "user": "854sqm2Cm4TB2XgPHWqSPSbnFAe3SMzdEDzZHpukQ8NHBPFropbnkFmEKiZPgwjMFC9PTjaFscR2UU6ZwFCqJzGMUiZVbTM",
36+ "pass": "sean-wks:user@example.com",
37+ "rig-id": "sean-wks",
38+ "nicehash": true,
39+ "keepalive": true,
40+ "enabled": true,
41+ "tls": null,
42+ "tls-fingerprint": null,
43+ "daemon": false
44+ }
45+ ],
46+ "print-time": 30,
47+ "retries": 5,
48+ "retry-pause": 5,
49+ "syslog": "false",
50+ "user-agent": "null",
51+ "watch": "true"
52+}
config.shnew file+72
@@ -0,0 +1,72 @@
1+#!/bin/bash
2+
3+# This script can be run standalone or as part of install.sh
4+
5+_EMAIL="user@example.com"
6+
7+_RECEIVE_WALLET="854sqm2Cm4TB2XgPHWqSPSbnFAe3SMzdEDzZHpukQ8NHBPFropbnkFmEKiZPgwjMFC9PTjaFscR2UU6ZwFCqJzGMUiZVbTM"
8+
9+_POOL_SERVER_URL="192.168.4.5"
10+_POOL_SERVER_PORT="3333"
11+
12+#################################
13+_API_ID="null"
14+_API_WORKER_ID="$HOSTNAME"
15+
16+_AUTOSAVE="true"
17+
18+_BACKGROUND="false"
19+
20+_COLORS="true"
21+
22+_CPU_ENABLED="true"
23+_CPU_HUGE_PAGES="true"
24+_CPU_HW_AES="null"
25+_CPU_PRIORITY="null"
26+_CPU_ASM="true"
27+_CPU_CN="0 1 2 3"
28+
29+_CPU_CN_0="false"
30+_CPU_CN_LITE_0="false"
31+
32+_DONATE_LEVEL="5"
33+
34+_DONATE_OVER_PROXY="1"
35+
36+_HTTP_ENABLED="true"
37+_HTTP_HOST=$(hostname --all-ip-addresses | awk '{print $1}')
38+_HTTP_PORT="8080"
39+_HTTP_ACCESS_TOKEN="null"
40+_HTTP_RESTRICTED="false"
41+
42+_LOG_FILE="null"
43+
44+_POOLS_ALGO="cn"
45+_POOLS_URL="$_POOL_SERVER_URL:$_POOL_SERVER_PORT"
46+_POOLS_USER="$_RECEIVE_WALLET"
47+_POOLS_PASS="$HOSTNAME:$_EMAIL"
48+_POOLS_RIG_ID="$HOSTNAME"
49+_POOLS_NICEHASH="true"
50+_POOLS_KEEPALIVE="true"
51+_POOLS_ENABLED="true"
52+_POOLS_TLS="null"
53+_POOLS_TLS_FINDERPRINT="null"
54+_POOLS_DAEMON="false"
55+
56+_PRINT_TIME="30"
57+
58+_RETRIES="5"
59+_RETRIES_PAUSE="5"
60+
61+_SYSLOG="false"
62+
63+_USER_AGENT="null"
64+
65+_WATCH="true"
66+
67+_CONFIG_JSON=$(jo -p -B api=$(jo -p id=$_API_ID worker-id=$_API_WORKER_ID) autosave=$_AUTOSAVE background=$_BACKGROUND colors=$_COLORS cpu=$(jo enabled=$_CPU_ENABLED huge-pages=$_CPU_HUGE_PAGES hw-aes=$_CPU_HW_AES priority=$_CPU_PRIORITY asm=$_CPU_ASM cn=$(jo -a $_CPU_CN) cn/0=$_CPU_CN_0 cn-lite/0=$_CPU_CN_LITE_0) donate-level=$_DONATE_LEVEL donate-over-proxy=$_DONATE_OVER_PROXY http=$(jo enabled=$_HTTP_ENABLED host=$_HTTP_HOST port=$_HTTP_PORT access-token=$_HTTP_ACCESS_TOKEN restricted=$_HTTP_RESTRICTED) logfile=$_LOGFILE pools=$(jo -a $(jo algo=$_POOLS_ALGO url=$_POOLS_URL user=$_POOLS_USER pass=$_POOLS_PASS rig-id=$_POOLS_RIG_ID nicehash=$_POOLS_NICEHASH keepalive=$_POOLS_KEEPALIVE enabled=$_POOLS_ENABLED tls=$_POOLS_TLS tls-fingerprint=$_POOLS_TLS_FINDERPRINT daemon=$_POOLS_DAEMON)) print-time=$_PRINT_TIME retries=$_RETRIES retry-pause=$_RETRIES_PAUSE syslog=$_SYSLOG user-agent=$_USER_AGENT watch=$_WATCH)
68+
69+echo "$_CONFIG_JSON" | tee config.json
70+
71+
72+
depends.sh+1−1
@@ -7,7 +7,7 @@ echo "#################################"
77
88if [ $_APT_DEPENDS = 1 ]; then
99
10− sudo apt install -y screen software-properties-common git build-essential cmake libuv1-dev libssl-dev libmicrohttpd-dev gcc g++
10+ sudo apt install -y jo screen software-properties-common git build-essential cmake libuv1-dev libssl-dev libmicrohttpd-dev gcc g++
1111
1212else
1313 echo "Depend install is set to NO ($_APT_DEPENDS) Skipping"
start.sh+1
@@ -12,6 +12,7 @@ if [ -z "$_XMRIG_SCREEN" ]; then
1212 # Load settings when run by crontab
1313 # Also ensures vm.nr_hugepages is set
1414 . settings.sh
15+ . functions.sh
1516
1617 # Check another instance is not already running
1718 if ! screen -list | grep -q "$_XMRIG_SCREEN"; then