- EliteDesk: 240x320 color ST7789 via Pico (Day 32 design)
- Pi: 128x64 mono SSD1306 horizontal bars (Day 85 redesign)
🦊 Built with love by Vixy
47 lines
1.1 KiB
Bash
47 lines
1.1 KiB
Bash
#!/bin/bash
|
|
# Install EliteDesk Stats Daemon as systemd service
|
|
# Run as root on each EliteDesk node
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
SERVICE_NAME="elitedesk-display"
|
|
INSTALL_DIR="/opt/elitedesk-display"
|
|
|
|
echo "Installing EliteDesk Stats Daemon..."
|
|
|
|
# Create install directory
|
|
mkdir -p "$INSTALL_DIR"
|
|
|
|
# Copy daemon script
|
|
cp "$SCRIPT_DIR/node_stats_daemon.py" "$INSTALL_DIR/"
|
|
chmod +x "$INSTALL_DIR/node_stats_daemon.py"
|
|
|
|
# Install Python dependencies
|
|
pip3 install pyserial --break-system-packages 2>/dev/null || pip3 install pyserial
|
|
|
|
# Create systemd service
|
|
cat > /etc/systemd/system/${SERVICE_NAME}.service << EOF
|
|
[Unit]
|
|
Description=EliteDesk Status Display Daemon
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
ExecStart=/usr/bin/python3 ${INSTALL_DIR}/node_stats_daemon.py
|
|
Restart=always
|
|
RestartSec=5
|
|
User=root
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
|
|
# Reload and enable
|
|
systemctl daemon-reload
|
|
systemctl enable ${SERVICE_NAME}
|
|
systemctl start ${SERVICE_NAME}
|
|
|
|
echo "Done! Service status:"
|
|
systemctl status ${SERVICE_NAME} --no-pager
|