chore: docs, plans archive, script updates, submodule refs

This commit is contained in:
datadunia
2026-05-31 08:20:46 +07:00
parent 25df78c519
commit 045099faff
10 changed files with 306 additions and 117 deletions
+19 -2
View File
@@ -25,6 +25,14 @@ NGINX_CONF="/etc/nginx/conf.d/nexusguard.conf"
DASHBOARD_DIR="/usr/share/nexusguard/dashboard"
BINARY_DIR="/usr/local/bin"
REMOVE_DB=false
while [[ "$#" -gt 0 ]]; do
case $1 in
--remove-db) REMOVE_DB=true; shift ;;
*) error "Unknown parameter: $1" ;;
esac
done
info "Uninstalling NexusGuard Server..."
# Stop and disable service
@@ -71,6 +79,13 @@ if [ -f "$NGINX_CONF" ]; then
info "Removed nginx config: $NGINX_CONF"
fi
if [ "$REMOVE_DB" = true ]; then
info "Removing PostgreSQL database and user..."
psql -U postgres -c "DROP DATABASE IF EXISTS nexusguard;" 2>/dev/null || true
psql -U postgres -c "DROP USER IF EXISTS nexusguard;" 2>/dev/null || true
info "Database and user removed."
fi
# Reload systemd and nginx
info "Reloading systemd daemon..."
systemctl daemon-reload
@@ -83,5 +98,7 @@ fi
info "Uninstall complete!"
echo ""
info "NexusGuard has been removed."
info "Note: PostgreSQL and Redis data were NOT removed."
info "To remove database data, run: docker compose down -v (if using Docker)"
if [ "$REMOVE_DB" = false ]; then
info "Note: PostgreSQL data was NOT removed."
info "To also remove database: $0 --remove-db"
fi