#!/bin/sh
set -e

restart() {
  if [ -d /run/systemd ]; then
    systemctl enable yandex-gideon.service
    systemctl restart yandex-gideon.service || true
  fi
}

case "$1" in
    configure)
        restart
        ;;

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

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

exit 0