monero-miner/install.sh

32 lines
675 B
Bash
Raw Normal View History

2021-03-02 20:42:39 +00:00
#!/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
2021-03-02 21:09:09 +00:00
apt update
apt install msr-tools numactl hwloc openssl libmicrohttpd12 git -y
2021-03-02 20:42:39 +00:00
# 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