#!/bin/sh
set -e

case "$1" in
    remove|deconfigure)
        if [ -d /run/systemd ]; then
            systemctl stop yandex-gideon.service || true
            systemctl disable yandex-gideon.service || true
        fi

        if [ "$1" = remove ]; then
            pam-auth-update --package --remove yandex-gideon
        fi
        ;;

    failed-upgrade|upgrade)
        ;;

    *)
        echo "prerm called with unknown argument \`$1'" >&2
        exit 1
        ;;
esac

exit 0
