#! /bin/sh
# postinst script for xivo-monitoring
#
# see: dh_installdeb(1)

set -e


case "$1" in
    configure)
        mkdir -p /var/www/munin/localdomain/localhost.localdomain
        # /var/www/munin must be owned by munin user
        chown -R munin:munin /var/www/munin

        if [ -e /etc/xivo/common.conf ]; then
            xivo-monitoring-update
        fi

        xivo-monitoring-update-graphics

    ;;

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

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
