#!/bin/bash REPOSITORY="https://git.willy.club/William/monero-miner" if [[ $EUID -ne 0 ]]; then echo "This script must run as root" exit 1 fi # install dependencies apt update apt install msr-tools numactl hwloc openssl libmicrohttpd12 git -y # clone repository cd /opt/ rm -r 'monero-miner' git clone $REPOSITORY monero-miner cd monero-miner # create service file echo "[Unit] Description=Monero Miner After=network.target [Service] Type=simple ExecStart=bash /opt/monero-miner/start-miner.sh TimeoutStartSec=0 [Install] WantedBy=default.target" > "/etc/systemd/system/monero-miner.service" systemctl daemon-reload systemctl enable monero-miner.service --now