#!/bin/sh

set -e

shortname=incubator

case "$1" in
    configure)
        # Only on install
        if [ -z "$2" ]; then
            if [ ! -d /etc/icingaweb2/enabledModules ]; then
                install -dpm 2770 -g icingaweb2 /etc/icingaweb2/enabledModules
            fi

            ln -sf /usr/share/icingaweb2/modules/$shortname /etc/icingaweb2/enabledModules/$shortname
        fi
    ;;

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

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

#DEBHELPER#

exit 0
