git.iko.soy/xmrig-bash-scripts
on e049916 help sign in
.gitignore−1
since splitsnapshots
unifiedsplit
@@ -1,7 +1,6 @@
1xmrig-cpu/
1xmrig-cpu/
2*.swp
2*.swp
3crontab
3crontab
4−null
5config.json
4config.json
6myconfig.json
5myconfig.json
7mysettings.sh
6mysettings.sh
README.md+17−18
@@ -11,7 +11,6 @@ A set of convenience scripts, written in bash, to help manage installation, conf
11There is allot to install so the install script will do most of the heavy lifting.
11There is allot to install so the install script will do most of the heavy lifting.
12At the start the expectation is that you have:
12At the start the expectation is that you have:
13* Computer running Ubuntu 18.04 (LTS)
13* Computer running Ubuntu 18.04 (LTS)
14−* Bash shell
15* User account with sudo privileges
14* User account with sudo privileges
16* Installed git
15* Installed git
17* Optionally installed [xmrig-proxy](https://github.com/xmrig/xmrig-proxy)
16* Optionally installed [xmrig-proxy](https://github.com/xmrig/xmrig-proxy)
@@ -22,37 +21,38 @@ Some knowledge of:
22* Linux Command Line Interface
21* Linux Command Line Interface
23* Linux shell `bash`
22* Linux shell `bash`
24
23
24+There is more to install but the install script will install the rest.
25+
25### Installation
26### Installation
26
27
271. Change to your user home directory.
281. Change to your user home directory.
28 `cd ~`
29 `cd ~`
30+
29−1. Install git.
31+2. Install git.
30 `sudo apt install git`
32 `sudo apt install git`
33+
31−1. Clone this project.
34+3. Clone this project.
32 `git clone https://github.com/seanwhe/xmrig-bash-scripts`
35 `git clone https://github.com/seanwhe/xmrig-bash-scripts`
36+
33−1. Change into the cloned directory.
37+4. Change into the cloned directory.
34 `cd xmrig-bash-scripts`
38 `cd xmrig-bash-scripts`
39+
40+5. Edit the settings file to your preference.
41+ `vim settings.sh`
42+
35−1. Run the install script
43+6. Run the install script
36 `./install.sh`
44 `./install.sh`
37−1. When prompted: "Enter your own settings?" enter 'y'es.
45+
38−1. Enter values for your:
39− 1. Pool server URL
40− 1. Pool server TCP port
41− 1. Receive wallet address
42− 1. Email address
43− 1. Miner identifier name
44−1. After install is complete. Attach to the screen session created during the installation.
46+7. After install is complete. Attach to the screen session created during the installation.
45 `screen -r`
47 `screen -r`
46
48
47### Operation
49### Operation
48
50
49Defaults - The settings.sh contains a number of variables. With the exception of the 'xmrig' binary, which is installed to `/usr/bin/xmrig`, all files remain in the cloned project directory `~/xmrig-bash-scripts`. Any files generated while running the scripts are also created in this directory.
51Defaults - The settings.sh contains a number of variables. With the exception of the 'xmrig' binary, which is installed to `/usr/bin/xmrig`, all files remain in the cloned project directory `~/xmrig-bash-scripts`. Any files generated while running the scripts are also created in this directory.
50
52
51−During install the folder source for [xmrig cpu](https://github.com/xmrig/xmrig) is cloned to `~/xmrig-bash-scripts/xmrig-cpu/`. The file `config.json`, used to configure xmrig, is also created in this path and is passed to xmrig at startup.
53+During install the folder source for [xmrig cpu](https://github.com/xmrig/xmrig) is cloned to `~/xmrig-bash-scripts/xmrig-cpu/`. The `config.json` is also created in this path.
52−
53−During installation it is recomended to enter your own settings. This creates a file named 'mysettings.sh' which will not be overwritten during future installs or upgrades. Values for variables found in 'mysettings.sh' are used to create 'config.json'.
54
54
55−This should work out the box, if you follow the installation steps and enter your own values for 'mysettings.sh.
55+This should work out the box, if you edit only the top section of `settings.sh` and followed the steps here.
56
56
57Once you have a running xmrig then you can start playing around and tweaking to suite requirements.
57Once you have a running xmrig then you can start playing around and tweaking to suite requirements.
58
58
@@ -67,7 +67,6 @@ The scripts are designed to be modular to promote resuse, execute exclusion and
67* crontab-on.sh - redefines the users crontab as created during install.
67* crontab-on.sh - redefines the users crontab as created during install.
68* depends.sh - installs dependancies required by xmrig and these scripts.
68* depends.sh - installs dependancies required by xmrig and these scripts.
69* functions.sh - a collection of functions used in various of the scripts.
69* functions.sh - a collection of functions used in various of the scripts.
70−* input.sh - prompts to enter values for creating 'mysettings.sh'
71* install.sh - the main entry point when first installing.
70* install.sh - the main entry point when first installing.
72* maintenance.sh - performs apt update, upgrade, autoremove and autoclean operations.
71* maintenance.sh - performs apt update, upgrade, autoremove and autoclean operations.
73* settings.sh - contains variables used by these scripts.
72* settings.sh - contains variables used by these scripts.
crontab.sh+1−1
@@ -12,7 +12,7 @@ crontab -r
12
12
13# Setup users contab
13# Setup users contab
14
14
15−crontab -l | { cat; echo "#Start at $_USER_CRONSTART on days $_USER_CRONDAYS
15+crontab -l | { cat; echo "#Start at $_USER_TIMESTART on days $_USER_CRONDAYS
160 $_USER_CRONSTART * * $_USER_CRONDAYS screen -dmS $_XMRIG_SCREEN xmrig --config=$_XMRIG_CONFIG_LOCATION"; } | crontab -
160 $_USER_CRONSTART * * $_USER_CRONDAYS screen -dmS $_XMRIG_SCREEN xmrig --config=$_XMRIG_CONFIG_LOCATION"; } | crontab -
17
17
18crontab -l | { cat; echo "#Stop at $_USER_TIMESTOP on days $_USER_CRONDAYS
18crontab -l | { cat; echo "#Stop at $_USER_TIMESTOP on days $_USER_CRONDAYS
depends.sh+1−1
@@ -4,7 +4,7 @@
4
4
5echo "${_GREEN}INSTALL DEPENDS STARTED${_RESET}"
5echo "${_GREEN}INSTALL DEPENDS STARTED${_RESET}"
6
6
7−if [ "$_APT_DEPENDS" -eq "1" ]; then
7+if [ $_APT_DEPENDS = 1 ]; then
8
8
9 # Install xmrig depends
9 # Install xmrig depends
10 sudo apt install -y software-properties-common git build-essential cmake libuv1-dev libssl-dev libmicrohttpd-dev libhwloc-dev gcc g++
10 sudo apt install -y software-properties-common git build-essential cmake libuv1-dev libssl-dev libmicrohttpd-dev libhwloc-dev gcc g++
functions.sh+9−17
@@ -1,6 +1,6 @@
1#!/bin/bash
1#!/bin/bash
2
2
3−echo -e "${_GREEN}LOADING FUNCTIONS${_RESET}"
3+echo -e "${_GREEN}FUNCTIONS LOADING${_RESET}"
4
4
5function prompt_confirm() {
5function prompt_confirm() {
6 while true; do
6 while true; do
@@ -14,19 +14,13 @@ function prompt_confirm() {
14}
14}
15
15
16function show_settings () {
16function show_settings () {
17− echo "${_CYAN}Settings from loaded environment:${_RESET}"
18− echo "${_GREEN}Pool URL:${_RESET}: $_POOLS_URL"
19− echo "${_GREEN}Recieve Wallet:${_RESET}: $_POOLS_USER"
20− echo "${_GREEN}Email Address:${_RESET}: $_POOLS_PASS"
21−}
22−
23−function show_mysettings () {
24 if [ -f $_WORK_DIR/$_MYSETTINGS_FILE ]; then
17 if [ -f $_WORK_DIR/$_MYSETTINGS_FILE ]; then
25− load_mysettings
26− echo "${_CYAN}Settings from mysettings.sh:${_RESET}"
18+ echo "${_CYAN}Settings loaded:${_RESET}"
27− echo "${_GREEN}Pool URL:${_RESET}: $_POOLS_URL"
19+ echo "${_GREEN}Pool URL:${_RESET}: $_POOL_SERVER_URL"
20+ echo "${_GREEN}Pool Port:${_RESET}: $_POOL_SERVER_PORT"
28− echo "${_GREEN}Recieve Wallet:${_RESET}: $_POOLS_USER"
21+ echo "${_GREEN}Recieve Wallet:${_RESET}: $_RECEIVE_WALLET"
29− echo "${_GREEN}Email Address:${_RESET}: $_POOLS_PASS"
22+ echo "${_GREEN}Email Address:${_RESET}: $_EMAIL"
23+ echo "${_GREEN}Worker Identity:${_RESET}: $_API_WORKER_ID"
30 fi
24 fi
31}
25}
32
26
@@ -37,9 +31,7 @@ function load_mysettings () {
37}
31}
38
32
39function my_config_json () {
33function my_config_json () {
40−
41− _CONFIG_JSON=$(jo -p -B api=$(jo 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) opencl=$(jo enabled=$_OPENCL_ENABLED cache=$_OPENCL_CACHE loader=$_OPENCL_LOADER platform=$_OPENCL_PLATFORM) 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) log-file=$_LOG_FILE 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)
34+ _CONFIG_JSON=$(jo -p -B api=$(jo 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)
42−
43}
35}
44
36
45function build_xmrig () {
37function build_xmrig () {
@@ -58,7 +50,7 @@ function build_xmrig () {
58 cd $_XMRIG_BUILD_LOCATION
50 cd $_XMRIG_BUILD_LOCATION
59
51
60 # Configure cmake scafolding
52 # Configure cmake scafolding
61− cmake ..
53+ cmake .. -DCMAKE_C_COMPILER=gcc-7 -DCMAKE_CXX_COMPILER=g++-7
62
54
63 # Compile the software
55 # Compile the software
64 make
56 make
input.sh+21−9
@@ -36,17 +36,29 @@ else
36
36
37 # Prompt user input
37 # Prompt user input
38
38
39− echo "Current pool URL: $_POOLS_URL"
39+ echo "Current pool URL: $_POOL_SERVER_URL"
40− read -p "Enter new pool URL: " _POOLS_URL
40+ read -p "Enter new pool URL: " _POOL_SERVER_URL
41− echo "_POOLS_URL=\"$_POOLS_URL\"" >> $_MYSETTINGS_FILE_LOCATION
42
41
43− echo "Current Receive Wallet address: $_POOLS_USER"
42+ echo "Current pool TCP Port: $_POOL_SERVER_PORT"
44− read -p "Enter new Receive Wallet address: " _POOLS_USER
43+ read -p "Enter new pool TCP Port: " _POOL_SERVER_PORT
45− echo "_POOLS_USER=\"$_POOLS_USER\"" >> $_MYSETTINGS_FILE_LOCATION
46
44
47− echo "Current email address: $_POOLS_PASS"
45+ echo "Current Receive Wallet address: $_RECEIVE_WALLET"
46+ read -p "Enter new Receive Wallet address: " _RECEIVE_WALLET
47+
48+ echo "Current email address: $_EMAIL"
48− read -p "Enter new email address: " _POOLS_PASS
49+ read -p "Enter new email address: " _EMAIL
50+
51+ echo "Current Miner Identifier: $_API_WORKER_ID"
52+ read -p "Enter Miner Identifier: " _API_WORKER_ID
53+
54+ # Write user input to file
55+
56+ echo "_POOL_SERVER_URL=\"$_POOL_SERVER_URL\"" >> $_MYSETTINGS_FILE_LOCATION
57+ echo "_POOL_SERVER_PORT=\"$_POOL_SERVER_PORT\"" >> $_MYSETTINGS_FILE_LOCATION
58+ echo "_RECEIVE_WALLET=\"$_RECEIVE_WALLET\"" >> $_MYSETTINGS_FILE_LOCATION
59+ echo "_EMAIL=\"$_EMAIL\"" >> $_MYSETTINGS_FILE_LOCATION
60+ echo "_API_WORKER_ID=\"$_API_WORKER_ID\"" >> $_MYSETTINGS_FILE_LOCATION
49− echo "_POOLS_PASS=\"$_POOLS_PASS\"" >> $_MYSETTINGS_FILE_LOCATION
61+ echo "_POOLS_URL=\"$_POOL_SERVER_URL:$_POOL_SERVER_PORT\"" >> $_MYSETTINGS_FILE_LOCATION
50
62
51 fi
63 fi
52
64
install.sh+18−7
@@ -30,27 +30,38 @@ fi
30
30
31# Load functions
31# Load functions
32. functions.sh
32. functions.sh
33+sleep 5
33
34
34# Get settings
35# Get settings
35. settings.sh
36. settings.sh
36−
37+sleep 5
37−# Update system
38−. maintenance.sh
39−
40−# Install dependencies
41−. depends.sh
42
38
43# User input
39# User input
44. input.sh
40. input.sh
41+sleep 5
45
42
46# Stop running instance
43# Stop running instance
47. stop.sh
44. stop.sh
48
45
46+# Update system
47+. maintenance.sh
48+sleep 5
49+
50+# Install dependencies
51+. depends.sh
52+sleep 5
53+
49# Get source and build by sourcing our build file
54# Get source and build by sourcing our build file
50. build.sh
55. build.sh
56+sleep 5
51
57
52# Create a config.json
58# Create a config.json
53. config.sh
59. config.sh
60+sleep 5
61+
62+# Setup crontab for user
63+. crontab.sh
64+sleep 5
54
65
55# Unset REPO variable so start script will execute program
66# Unset REPO variable so start script will execute program
56SCREEN=""
67SCREEN=""
@@ -59,4 +70,4 @@ SCREEN=""
59. start.sh
70. start.sh
60
71
61
72
62−echo -e "${_CYAN}INSTALLATION COMPLETED${_RESET}"
73+echo -e "${_CYAN}INSTALLATION STOPPED${_RESET}"
maintenance.sh+1−1
@@ -2,7 +2,7 @@
2
2
3echo "${_GREEN}MAINTENANCE STARTED${_RESET}"
3echo "${_GREEN}MAINTENANCE STARTED${_RESET}"
4
4
5−if [ "$_APT_MAINETANCE" -eq "1" ]; then
5+if [ $_APT_MAINETANCE = 1 ]; then
6
6
7 sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt autoclean
7 sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt autoclean
8
8
settings.sh+16−21
@@ -1,13 +1,13 @@
1#!/bin/bash
1#!/bin/bash
2
2
3−echo -e "${_GREEN}LOADING DEFAULT SETTINGS${_RESET}"
3+echo -e "${_GREEN}DEFAULT SETTINGS LOADING${_RESET}"
4
4
5−_EMAIL="spam@iko.soy"
5+_EMAIL="miners@prepaidmeters.com"
6
6
7−_RECEIVE_WALLET="44FADBDhNRvjJszF5mLS4VCwZ71mY7ftfUErEisPoT724hb5eYuvuFqWthniY8dGPBTcWuBoeLrLJVkxLHCb1Lsd4DdbZzZ"
7+_RECEIVE_WALLET="854sqm2Cm4TB2XgPHWqSPSbnFAe3SMzdEDzZHpukQ8NHBPFropbnkFmEKiZPgwjMFC9PTjaFscR2UU6ZwFCqJzGMUiZVbTM"
8
8
9−_POOL_SERVER_URL="xmrpool.eu"
9+_POOL_SERVER_URL="pool.supportxmr.com"
10−_POOL_SERVER_PORT="5555"
10+_POOL_SERVER_PORT="3333"
11
11
12# Call function
12# Call function
13show_settings
13show_settings
@@ -16,7 +16,7 @@ show_settings
16# DO NOT CHANGE AFTER THIS POINT UNLESS YOU KNOW WHAT YOU ARE DOING #
16# DO NOT CHANGE AFTER THIS POINT UNLESS YOU KNOW WHAT YOU ARE DOING #
17#######################################################################
17#######################################################################
18
18
19−_API_ID='null'
19+_API_ID="null"
20_API_WORKER_ID="$HOSTNAME"
20_API_WORKER_ID="$HOSTNAME"
21
21
22_AUTOSAVE="true"
22_AUTOSAVE="true"
@@ -34,29 +34,24 @@ calc_threads
34_CPU_ENABLED="true"
34_CPU_ENABLED="true"
35_CPU_HUGE_PAGES="true"
35_CPU_HUGE_PAGES="true"
36_CPU_HW_AES="$_AES_NI"
36_CPU_HW_AES="$_AES_NI"
37−_CPU_PRIORITY='null'
37+_CPU_PRIORITY="null"
38_CPU_ASM="true"
38_CPU_ASM="true"
39_CPU_CN="$_ENV_CPU_THREAD_AFFINITY"
39_CPU_CN="$_ENV_CPU_THREAD_AFFINITY"
40
40
41_CPU_CN_0="false"
41_CPU_CN_0="false"
42_CPU_CN_LITE_0="false"
42_CPU_CN_LITE_0="false"
43
43
44−_OPENCL_ENABLED="false"
45−_OPENCL_CACHE="true"
46−_OPENCL_LOADER='null'
47−_OPENCL_PLATFORM="AMD"
48−
49−_DONATE_LEVEL="0"
44+_DONATE_LEVEL="5"
50
45
51_DONATE_OVER_PROXY="1"
46_DONATE_OVER_PROXY="1"
52
47
53_HTTP_ENABLED="true"
48_HTTP_ENABLED="true"
54_HTTP_HOST=$(hostname --all-ip-addresses | awk '{print $1}')
49_HTTP_HOST=$(hostname --all-ip-addresses | awk '{print $1}')
55_HTTP_PORT="8080"
50_HTTP_PORT="8080"
56−_HTTP_ACCESS_TOKEN='null'
51+_HTTP_ACCESS_TOKEN="null"
57_HTTP_RESTRICTED="false"
52_HTTP_RESTRICTED="false"
58
53
59−_LOG_FILE='null'
54+_LOG_FILE="null"
60
55
61_POOLS_ALGO="cn/r"
56_POOLS_ALGO="cn/r"
62_POOLS_URL="$_POOL_SERVER_URL:$_POOL_SERVER_PORT"
57_POOLS_URL="$_POOL_SERVER_URL:$_POOL_SERVER_PORT"
@@ -66,8 +61,8 @@ _POOLS_RIG_ID="$HOSTNAME"
66_POOLS_NICEHASH="true"
61_POOLS_NICEHASH="true"
67_POOLS_KEEPALIVE="true"
62_POOLS_KEEPALIVE="true"
68_POOLS_ENABLED="true"
63_POOLS_ENABLED="true"
69−_POOLS_TLS='null'
64+_POOLS_TLS="null"
70−_POOLS_TLS_FINDERPRINT='null'
65+_POOLS_TLS_FINDERPRINT="null"
71_POOLS_DAEMON="false"
66_POOLS_DAEMON="false"
72
67
73_PRINT_TIME="30"
68_PRINT_TIME="30"
@@ -77,7 +72,7 @@ _RETRIES_PAUSE="5"
77
72
78_SYSLOG="false"
73_SYSLOG="false"
79
74
80−_USER_AGENT='null'
75+_USER_AGENT="null"
81
76
82_WATCH="true"
77_WATCH="true"
83
78
@@ -95,7 +90,7 @@ _XMRIG_CLONE="xmrig-cpu"
95_XMRIG_CLONE_LOCATION="$_WORK_DIR/$_XMRIG_CLONE"
90_XMRIG_CLONE_LOCATION="$_WORK_DIR/$_XMRIG_CLONE"
96
91
97# Set branch from which to build
92# Set branch from which to build
98−_XMRIG_BRANCH="master"
93+_XMRIG_BRANCH="beta"
99
94
100# Set build directory
95# Set build directory
101_XMRIG_BUILD="build"
96_XMRIG_BUILD="build"
@@ -119,8 +114,8 @@ _XMRIG_CONFIG="config.json"
119_XMRIG_CONFIG_LOCATION="$_WORK_DIR/$_XMRIG_CONFIG"
114_XMRIG_CONFIG_LOCATION="$_WORK_DIR/$_XMRIG_CONFIG"
120
115
121# Set values for crontab
116# Set values for crontab
122−_USER_CRONSTART="17"
117+_USER_CRONSTART="18"
123−_USER_CRONSTOP="8"
118+_USER_CRONSTOP="6"
124_USER_CRONDAYS="1-5"
119_USER_CRONDAYS="1-5"
125
120
126# Set the name of the screen created by start script
121# Set the name of the screen created by start script
start.sh+7−33
@@ -10,46 +10,20 @@ echo "${_GREEN}MINING STARTED${_RESET}"
10. functions.sh
10. functions.sh
11. settings.sh
11. settings.sh
12
12
13−# if ! screen -list | grep -q "$_XMRIG_SCREEN"; then
13+if ! screen -list | grep -q "$_XMRIG_SCREEN"; then
14
14
15 # Call functions
15 # Call functions
16 show_settings
16 show_settings
17− show_mysettings
18− # start_xmrig
17+ start_xmrig
19
18
20 # List screen
19 # List screen
21− # screen -ls
20+ screen -ls
22−# else
21+else
23
22
24 # List screen
23 # List screen
25− # screen -ls
24+ screen -ls
26−
25+
27−# fi
26+fi
28−echo "[Unit]" | sudo tee /etc/systemd/system/xmrig.service
29−echo "Description=XMRIG service" | sudo tee -a /etc/systemd/system/xmrig.service
30−echo "After=network.target" | sudo tee -a /etc/systemd/system/xmrig.service
31−echo "StartLimitIntervalSec=0" | sudo tee -a /etc/systemd/system/xmrig.service
32−echo "[Service]" | sudo tee -a /etc/systemd/system/xmrig.service
33−echo "Type=simple" | sudo tee -a /etc/systemd/system/xmrig.service
34−echo "Restart=always" | sudo tee -a /etc/systemd/system/xmrig.service
35−echo "RestartSec=3" | sudo tee -a /etc/systemd/system/xmrig.service
36−echo "User=root" | sudo tee -a /etc/systemd/system/xmrig.service
37−echo "ExecStart=$_XMRIG_BUILD_LOCATION/xmrig --config=$_XMRIG_CONFIG_LOCATION" | sudo tee -a /etc/systemd/system/xmrig.service
38−echo "" | sudo tee -a /etc/systemd/system/xmrig.service
39−echo "[Install]" | sudo tee -a /etc/systemd/system/xmrig.service
40−echo "WantedBy=multi-user.target" | sudo tee -a /etc/systemd/system/xmrig.service
41−
42−echo "STARTING XMRIG/SERVICES"
43−
44−sudo service logrotate start
45−sudo service ntp start
46−sudo service xmrig start
47−
48−echo "STARTING XMRIG/SERVICES @ BOOT"
49−
50−sudo systemctl enable logrotate
51−sudo systemctl enable ntp
52−sudo systemctl enable xmrig
53
27
54echo "${_CYAN}MINING RUNNING${_RESET}"
28echo "${_CYAN}MINING RUNNING${_RESET}"
55echo "${_YELLOW} The process is running in a screen session."
29echo "${_YELLOW} The process is running in a screen session."
update.sh+1−3
@@ -1,11 +1,9 @@
1#!/bin/bash
1#!/bin/bash
2
2
3−echo "${_GREEN}UPDATE STARTED${_RESET}"
4−
5git pull
3git pull
6
4
7# install
5# install
8. install.sh
6. install.sh
9sleep 5
7sleep 5
10
8
11−echo "${_CYAN}UPDATE COMPLETE${_RESET}"
9+echo "${_GREEN}UPDATE COMPLETE${_RESET}"