git.iko.soy/xmrig-bash-scripts
on master help sign in
.
c3ce076iko
install.sh−4
@@ -59,10 +59,6 @@ sleep 5
59. config.sh
59. config.sh
60sleep 5
60sleep 5
61
61
62−# Setup crontab for user
63−. crontab.sh
64−sleep 5
65−
66# Unset REPO variable so start script will execute program
62# Unset REPO variable so start script will execute program
67SCREEN=""
63SCREEN=""
68
64
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]" | tee /etc/systemd/system/xmrig.service
29+echo "Description=XMRIG service" | tee -a /etc/systemd/system/xmrig.service
30+echo "After=network.target" | tee -a /etc/systemd/system/xmrig.service
31+echo "StartLimitIntervalSec=0" | tee -a /etc/systemd/system/xmrig.service
32+echo "[Service]" | tee -a /etc/systemd/system/xmrig.service
33+echo "Type=simple" | tee -a /etc/systemd/system/xmrig.service
34+echo "Restart=always" | tee -a /etc/systemd/system/xmrig.service
35+echo "RestartSec=3" | tee -a /etc/systemd/system/xmrig.service
36+echo "User=root" | tee -a /etc/systemd/system/xmrig.service
37+echo "ExecStart=$(pwd)/xmrig --config=$_XMRIG_CONFIG_LOCATION" | tee -a /etc/systemd/system/xmrig.service
38+echo "" | tee -a /etc/systemd/system/xmrig.service
39+echo "[Install]" | tee -a /etc/systemd/system/xmrig.service
40+echo "WantedBy=multi-user.target" | tee -a /etc/systemd/system/xmrig.service
41+
42+echo "STARTING XMRIG/SERVICES"
43+
44+service logrotate start
45+service ntp start
46+service xmrig start
47+
48+echo "STARTING XMRIG/SERVICES @ BOOT"
49+
50+systemctl enable logrotate
51+systemctl enable ntp
52+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."