diff --git a/install.sh b/install.sh index bffc84e..61cd743 100755 --- a/install.sh +++ b/install.sh @@ -59,10 +59,6 @@ sleep 5 . config.sh sleep 5 -# Setup crontab for user -. crontab.sh -sleep 5 - # Unset REPO variable so start script will execute program SCREEN="" diff --git a/start.sh b/start.sh index 7848689..f84805e 100755 --- a/start.sh +++ b/start.sh @@ -10,21 +10,46 @@ echo "${_GREEN}MINING STARTED${_RESET}" . functions.sh . settings.sh -if ! screen -list | grep -q "$_XMRIG_SCREEN"; then +# if ! screen -list | grep -q "$_XMRIG_SCREEN"; then # Call functions show_settings show_mysettings - start_xmrig + # start_xmrig # List screen - screen -ls -else + # screen -ls +# else # List screen - screen -ls + # screen -ls -fi +# fi +echo "[Unit]" | tee /etc/systemd/system/xmrig.service +echo "Description=XMRIG service" | tee -a /etc/systemd/system/xmrig.service +echo "After=network.target" | tee -a /etc/systemd/system/xmrig.service +echo "StartLimitIntervalSec=0" | tee -a /etc/systemd/system/xmrig.service +echo "[Service]" | tee -a /etc/systemd/system/xmrig.service +echo "Type=simple" | tee -a /etc/systemd/system/xmrig.service +echo "Restart=always" | tee -a /etc/systemd/system/xmrig.service +echo "RestartSec=3" | tee -a /etc/systemd/system/xmrig.service +echo "User=root" | tee -a /etc/systemd/system/xmrig.service +echo "ExecStart=$(pwd)/xmrig --config=$_XMRIG_CONFIG_LOCATION" | tee -a /etc/systemd/system/xmrig.service +echo "" | tee -a /etc/systemd/system/xmrig.service +echo "[Install]" | tee -a /etc/systemd/system/xmrig.service +echo "WantedBy=multi-user.target" | tee -a /etc/systemd/system/xmrig.service + +echo "STARTING XMRIG/SERVICES" + +service logrotate start +service ntp start +service xmrig start + +echo "STARTING XMRIG/SERVICES @ BOOT" + +systemctl enable logrotate +systemctl enable ntp +systemctl enable xmrig echo "${_CYAN}MINING RUNNING${_RESET}" echo "${_YELLOW} The process is running in a screen session."