File: /var/lib/dpkg/info/bitninja-process-analysis.postinst
#!/bin/sh
set -e
case "$1" in
configure)
if command -v systemctl >/dev/null 2>&1; then
systemctl daemon-reload
# Handle instance-based service (@false)
if [ -f "/etc/systemd/system/bitninja-process-analysis@.service" ]; then
systemctl enable bitninja-process-analysis@false
if [ -z "$2" ]; then
echo "Starting bitninja-process-analysis@false (fresh install)."
systemctl start bitninja-process-analysis@false
else
echo "Restarting bitninja-process-analysis@false (upgrade from $2)."
systemctl restart bitninja-process-analysis@false
fi
fi
else
echo "systemctl not found, unable to manage bitninja-process-analysis services."
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
echo "postinst called with argument '$1'. No action taken."
;;
*)
echo "postinst called with unknown argument '$1'" >&2
exit 1
;;
esac
exit 0