fix: sensor-proxy installer fails silently on containers without snapshots

The SNAPSHOT_START extraction used grep in a pipeline with pipefail
enabled. When a container config has no snapshot sections (no lines
starting with '['), grep returns exit code 1, causing set -e to
terminate the script without any error message.

This affected newly created containers that hadn't been snapshotted yet,
which is the common case for fresh Pulse installations via community
scripts.

Related to #780
This commit is contained in:
rcourtman 2025-12-03 09:04:45 +00:00
parent d2ec1242f0
commit 1a5dbd9461

View file

@ -3225,7 +3225,8 @@ if [[ "$STANDALONE" == false && "$CONTAINER_ON_THIS_NODE" == true ]]; then
fi
# Extract line number where snapshots start (first line starting with [)
SNAPSHOT_START=$(grep -n '^\[' "$TEMP_CONFIG" | head -1 | cut -d: -f1)
# Note: grep returns 1 if no match, which fails with pipefail - use || true to suppress
SNAPSHOT_START=$(grep -n '^\[' "$TEMP_CONFIG" | head -1 | cut -d: -f1 || true)
if grep -Eq '^mp[0-9]+:.*pulse-sensor-proxy|^mp[0-9]+:.*mnt/pulse-proxy' "$TEMP_CONFIG" 2>/dev/null; then
print_info "Removing mp mounts for pulse-sensor-proxy to keep snapshots and migrations working"