#!/bin/sh set -e # Create user and group if they don't exist if ! getent group p2pool >/dev/null; then addgroup --system p2pool fi if ! getent passwd p2pool >/dev/null; then adduser --system --ingroup p2pool --no-create-home \ --home /var/lib/p2pool --shell /usr/sbin/nologin \ --gecos "P2Pool Service" p2pool fi # Create data directory mkdir -p /var/lib/p2pool chown p2pool:p2pool /var/lib/p2pool chmod 750 /var/lib/p2pool # Create log directory mkdir -p /var/log/p2pool chown p2pool:p2pool /var/log/p2pool chmod 750 /var/log/p2pool # Set binary permissions chown root:root /opt/p2pool/p2pool chmod 755 /opt/p2pool/p2pool # Reload systemd if [ -d /run/systemd/system ]; then systemctl daemon-reload fi echo "" echo "✅ P2Pool installed successfully!" echo "" echo "📋 Before starting P2Pool, you MUST:" echo "" echo "1. Edit the systemd service file to set your Monero wallet address:" echo " sudo systemctl edit --full p2pool.service" echo "" echo " Replace 'YOUR_MONERO_WALLET_ADDRESS' with your actual Monero wallet address" echo " and configure --host and --rpc-port to point to your Monero node" echo "" echo "2. Start P2Pool:" echo " sudo systemctl enable p2pool.service" echo " sudo systemctl start p2pool.service" echo "" echo "3. Check status:" echo " sudo systemctl status p2pool.service" echo " sudo journalctl -u p2pool -f" echo "" echo "Data directory: /var/lib/p2pool" echo "Log directory: /var/log/p2pool" echo "Binary: /opt/p2pool/p2pool" echo "" echo "For help:" echo " /opt/p2pool/p2pool --help" echo "" exit 0