From c39702379124dbce1dd5a7ca13666adbbfc1e340 Mon Sep 17 00:00:00 2001 From: Gary Benson Date: Fri, 10 Nov 2023 22:51:32 +0000 Subject: [PATCH] Mine on the p2pool node too --- setup-miner.sh | 9 +++++---- setup-p2pool-node.sh | 9 +++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/setup-miner.sh b/setup-miner.sh index 579f802..d35538c 100644 --- a/setup-miner.sh +++ b/setup-miner.sh @@ -13,7 +13,8 @@ hash=ff6e67d725ee64b4607dc6490a706dc9234c708cff814477de52d3beb781c6a1 if [ -d /opt/xmrig ]; then SKIP_SETUP=yes -else +fi +if [ -z "$SKIP_SETUP" ]; then for snap in lxd core20 snapd; do snap remove $snap done @@ -23,12 +24,12 @@ else apt-get autoremove -y --purge modemmanager - #apt-get update - #apt-get upgrade -y - #apt-get dist-upgrade -y + apt-get update + apt-get upgrade -y fi mkdir -p /opt/xmrig/bin && cd /opt/xmrig +[ -e $tarball ] && exit 1 curl -Lo $tarball $download/v$version/$tarball echo $hash $tarball > $tarball.SHA256SUM sha256sum -c $tarball.SHA256SUM diff --git a/setup-p2pool-node.sh b/setup-p2pool-node.sh index 5704485..3fe6896 100644 --- a/setup-p2pool-node.sh +++ b/setup-p2pool-node.sh @@ -84,7 +84,6 @@ EOF apt-get update apt-get upgrade -y -apt-get dist-upgrade -y apt-get install -y docker-ce docker-compose-plugin for sn in monerod p2pool; do @@ -114,8 +113,14 @@ RestartSec=30s WantedBy=multi-user.target EOF +SKIP_SETUP=1 bash /opt/monero-node/setup-miner.sh +sed -i \ + -e 's/network\.target/p2pool.service\nRequires=p2pool.service/' \ + -e 's/p2pool\.gbenson\.net/127.0.0.1/g' \ + /lib/systemd/system/xmrig.service + systemctl daemon-reload -systemctl enable p2pool +systemctl enable p2pool xmrig # Adding users isn't necessary except to avoid numeric UIDs in top addgroup --system --gid 801 monerod