git.iko.soy/xmrig-bash-scripts
on master help sign in
install.sh−11
since splitsnapshots
unifiedsplit
@@ -30,38 +30,27 @@ fi
30
30
31# Load functions
31# Load functions
32. functions.sh
32. functions.sh
33−sleep 5
34
33
35# Get settings
34# Get settings
36. settings.sh
35. settings.sh
37−sleep 5
38
36
39# Update system
37# Update system
40. maintenance.sh
38. maintenance.sh
41−sleep 5
42
39
43# Install dependencies
40# Install dependencies
44. depends.sh
41. depends.sh
45−sleep 5
46
42
47# User input
43# User input
48. input.sh
44. input.sh
49−sleep 5
50
45
51# Stop running instance
46# Stop running instance
52. stop.sh
47. stop.sh
53
48
54# Get source and build by sourcing our build file
49# Get source and build by sourcing our build file
55. build.sh
50. build.sh
56−sleep 5
57
51
58# Create a config.json
52# Create a config.json
59. config.sh
53. config.sh
60−sleep 5
61−
62−# Setup crontab for user
63−. crontab.sh
64−sleep 5
65
54
66# Unset REPO variable so start script will execute program
55# Unset REPO variable so start script will execute program
67SCREEN=""
56SCREEN=""
start.sh+32−7
@@ -10,21 +10,46 @@ 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
17 show_mysettings
18− start_xmrig
18+ # start_xmrig
19
19
20 # List screen
20 # List screen
21− screen -ls
21+ # screen -ls
22−else
22+# else
23
23
24 # List screen
24 # List screen
25− screen -ls
25+ # screen -ls
26−
26+
27−fi
27+# 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
28
53
29echo "${_CYAN}MINING RUNNING${_RESET}"
54echo "${_CYAN}MINING RUNNING${_RESET}"
30echo "${_YELLOW} The process is running in a screen session."
55echo "${_YELLOW} The process is running in a screen session."