Files
Synapsis/deploy/uninstall.sh
T
cyph3rasi 21258edd95 Replace PostgreSQL and Docker deployment with embedded Turso, Drizzle relational queries v2, native systemd deployment on port 43821, and fresh SQLite migrations.
Hop-State: A_06FP5KEDBTB4A9ZT7QB498G
Hop-Proposal: R_06FP5KDWMCKVVMQZT4MVZ28
Hop-Task: T_06FP5DZ7T0G45FG93PT90B8
Hop-Attempt: AT_06FP5DZ7T0PKQW99V27JCV8
2026-07-14 15:44:42 -07:00

26 lines
634 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
APP_DIR="${APP_DIR:-/opt/synapsis}"
DATA_DIR="${DATA_DIR:-/var/lib/synapsis}"
ENV_FILE="${ENV_FILE:-/etc/synapsis.env}"
if [[ ${EUID} -ne 0 ]]; then
echo "Run this uninstaller as root." >&2
exit 1
fi
systemctl disable --now synapsis 2>/dev/null || true
rm -f /etc/systemd/system/synapsis.service
systemctl daemon-reload
rm -rf "$APP_DIR"
if [[ "${1:-}" == "--purge-data" ]]; then
rm -rf "$DATA_DIR"
rm -f "$ENV_FILE"
userdel synapsis 2>/dev/null || true
echo "Synapsis and its database were removed."
else
echo "Synapsis was removed; $DATA_DIR and $ENV_FILE were preserved."
fi