#!/bin/sh


set -e


#-------------------------------------------------------------------------


post_install() {
    APP="yandex-solomon-discovery"

    if [ -x /bin/systemctl -a -f /etc/systemd/system/${APP}.service ] ; then
        if ! /bin/systemctl restart ${APP} ; then
            echo "Cannot restart ${APP} service!"
        fi
    fi
}


#-------------------------------------------------------------------------


case "$1" in
    configure)
        post_install
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst was called with unknown argument '$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0
