Files
p2pool/debian/postinst
Wang Defa b16da1a3c5
Some checks failed
Build and Release / build-and-test (arm64, ubuntu) (push) Successful in 29s
Build and Release / build-and-test (amd64, ubuntu) (push) Failing after 16m22s
Build and Release / build-and-test (amd64, alpine) (push) Failing after 16m24s
Build and Release / build-and-test (arm64, alpine) (push) Successful in 28m28s
Build and Release / release (push) Has been skipped
优化 CI 构建流程
2025-12-08 11:04:48 +08:00

62 lines
1.6 KiB
Bash
Executable File

#!/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