#!/bin/sh
# Stop the record index after continuity.service stops (ADR-006 §2). Runs as root, from
# ExecStopPost. The container's data was on tmpfs, so removing it wipes the RAM copy.
# Install as /opt/continuity/bin/index-stop.
set -u
engine=${CONTINUITY_CONTAINER:-$(command -v podman || command -v docker || true)}
if [ -n "$engine" ]; then "$engine" rm -f continuity-index >/dev/null 2>&1 || true; fi
rm -f /run/continuity/index.env /run/continuity/index.pg.env
exit 0
