Files
ubuntu-bare-metal/stacks/server-ui/scripts/restart-stack.sh
T
tomasz-syn-grzegorza 359afb3a59 Initial import: bare-metal stacks, Server UI, GPU fan, tutorials.
Infrastructure configs for GMKtec K11 (Docker, vLLM, LocalAI, ComfyUI,
control-plane, gpu-fan agent, Server UI with CLI/file explorer/GPU fan curve).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 12:02:04 +00:00

18 lines
661 B
Bash
Executable File

#!/usr/bin/env bash
# Restart gpu-fan + server-ui after code sync. Requires: sudo scripts/restart-stack.sh
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ "${EUID}" -ne 0 ]]; then
echo "Run: sudo ${SCRIPT_DIR}/restart-stack.sh"
exit 1
fi
systemctl restart gpu-fan
sleep 2
systemctl restart server-ui
sleep 2
echo "gpu-fan: $(systemctl is-active gpu-fan)"
echo "server-ui: $(systemctl is-active server-ui)"
ss -tlnp | grep -E '18090|8091' || true
UI_KEY="$(grep '^API_KEY=' /opt/control-plane/.env | cut -d= -f2-)"
curl -sf "http://127.0.0.1:8091/api/gpu-fan/health" -H "X-API-Key: ${UI_KEY}" || echo "health check failed"