overheat monitor with auto poweroff

- needs passwordless sudo on target machine or deploy to run as root
This commit is contained in:
Mikkeli Matlock
2026-01-25 19:53:43 +09:00
parent 22e9cd2c43
commit 15a805f7fe
9 changed files with 362 additions and 3 deletions

View File

@@ -27,6 +27,7 @@ SERVICE_NAME=$(read_json service_name)
SSH_TARGET="$PI_USER@$PI_HOST"
BUILD_DIR="$PROJECT_ROOT/pi/ui/build/elinux/arm64/release/bundle"
CONFIG_SRC="$PROJECT_ROOT/pi/ui/config.json"
echo "=== Smart Serow Deploy ==="
echo "Target: $SSH_TARGET:$REMOTE_PATH"
@@ -44,6 +45,16 @@ rsync -avz --delete \
"$BUILD_DIR/" \
"$SSH_TARGET:$REMOTE_PATH/bundle/"
# Sync config.json (sits next to executable in bundle)
if [ -f "$CONFIG_SRC" ]; then
echo ""
echo "Syncing config.json..."
rsync -avz "$CONFIG_SRC" "$SSH_TARGET:$REMOTE_PATH/bundle/config.json"
else
echo ""
echo "Note: No config.json found, using defaults"
fi
# Restart service if requested
RESTART="${1:-}"
if [ "$RESTART" = "--restart" ] || [ "$RESTART" = "-r" ]; then