#!/bin/bash

set -uo pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
STATUS=0

"$SCRIPT_DIR/aiwatch-uninstall/aiwatch-uninstall" || STATUS=$?

# --nopayload packages write no receipt. Defensively clear any stale receipt
# sharing this identifier so receipt-based MDM detection stays clean.
/usr/sbin/pkgutil --forget com.runlayer.aiwatch.uninstall >/dev/null 2>&1 || true

exit "$STATUS"
