#!/usr/bin/env bash # Update the PON Fleet web server in place: pull the repo, reinstall runtime # deps (tough-cookie only — Electron is a devDep and is skipped), restart. # Run as root (or via sudo) on the LXC. Override the path with PONFW_DIR. set -euo pipefail REPO="${PONFW_DIR:-/opt/ponfw}" SERVICE="pon-fleet-web" echo "==> Updating $REPO" cd "$REPO" git pull --ff-only echo "==> Installing runtime dependencies (omit dev / Electron)" # `npm install` (not `npm ci`) because this repo gitignores package-lock.json. npm install --omit=dev --no-audit --no-fund echo "==> Restarting $SERVICE" systemctl restart "$SERVICE" sleep 1 systemctl --no-pager --lines=8 status "$SERVICE" || true echo "==> Done."