#!/bin/sh set -e # Create user and group if they don't exist if ! getent group xxxigcc >/dev/null; then addgroup --system xxxigcc fi if ! getent passwd xxxigcc >/dev/null; then adduser --system --ingroup xxxigcc --no-create-home \ --home /opt/xxxigcc --shell /usr/sbin/nologin \ --gecos "XXXigCC Service" xxxigcc fi # Create log directory mkdir -p /var/log/xxxigcc chown xxxigcc:xxxigcc /var/log/xxxigcc chmod 750 /var/log/xxxigcc # Create config directory mkdir -p /etc/xxxigcc # Copy default configs if they don't exist if [ ! -f /etc/xxxigcc/config.json ]; then cp /opt/xxxigcc/config.json /etc/xxxigcc/config.json chown xxxigcc:xxxigcc /etc/xxxigcc/config.json chmod 640 /etc/xxxigcc/config.json fi if [ ! -f /etc/xxxigcc/config_cc.json ]; then cp /opt/xxxigcc/config_cc.json /etc/xxxigcc/config_cc.json chown xxxigcc:xxxigcc /etc/xxxigcc/config_cc.json chmod 640 /etc/xxxigcc/config_cc.json fi # Set permissions chown -R xxxigcc:xxxigcc /opt/xxxigcc chmod 755 /opt/xxxigcc chmod 755 /opt/xxxigcc/xxxigServer chmod 755 /opt/xxxigcc/xxxigDaemon chmod 755 /opt/xxxigcc/xxxigMiner # Reload systemd if [ -d /run/systemd/system ]; then systemctl daemon-reload # Note: Services are NOT auto-enabled or auto-started # Users should manually enable the services they need: # systemctl enable xxxigcc-server.service # systemctl start xxxigcc-server.service # or # systemctl enable xxxigcc-daemon.service # systemctl start xxxigcc-daemon.service fi echo "" echo "✅ XXXigCC installed successfully!" echo "" echo "📋 Service Information:" echo "" echo " xxxigcc-server - Control server with web UI (uses config_cc.json)" echo " xxxigcc-daemon - Mining client daemon (uses config.json, auto-calls xxxigMiner)" echo "" echo "To start the server (central control):" echo " sudo systemctl enable xxxigcc-server.service" echo " sudo systemctl start xxxigcc-server.service" echo "" echo "To start the daemon (mining client):" echo " sudo systemctl enable xxxigcc-daemon.service" echo " sudo systemctl start xxxigcc-daemon.service" echo "" echo "Configuration files:" echo " /etc/xxxigcc/config.json - Daemon/Miner configuration" echo " /etc/xxxigcc/config_cc.json - Server configuration" echo "" echo "Binaries location:" echo " /opt/xxxigcc/xxxigServer - Control server" echo " /opt/xxxigcc/xxxigDaemon - Client daemon (auto-calls xxxigMiner)" echo " /opt/xxxigcc/xxxigMiner - Miner executable" echo "" exit 0