#!/bin/sh
# Pre-removal script for the Phage .deb package.
# Stops and disables the privileged helper service before removal.

if command -v systemctl > /dev/null 2>&1; then
    systemctl stop phage-helper 2>/dev/null || true
    systemctl disable phage-helper 2>/dev/null || true
fi

rm -f /etc/systemd/system/phage-helper.service 2>/dev/null || true
systemctl daemon-reload 2>/dev/null || true

exit 0
