This commit is contained in:
iko 2023-03-28 21:25:06 +03:00
parent d31e06fb5f
commit c3ce076b3b
Signed by untrusted user: iko
GPG Key ID: 82C257048D1026F2
2 changed files with 31 additions and 10 deletions

View File

@ -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=""

View File

@ -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."