#!/bin/sh -e

case "$1" in
    remove|purge)
        if [ -x /bin/systemctl -a -f /etc/systemd/system/otel-collector.service ] ; then
            if ! /bin/systemctl stop otel-collector ; then
                echo "Cannot stop otel-collector service!"
            fi
            if ! /bin/systemctl disable otel-collector ; then
                echo "Cannot disable otel-collector service!"
            fi
        fi
    ;;
esac
