#!/bin/sh
set -e

case "$1" in
    configure)
        # Register the PMDA with PMCD
        if [ -x /var/lib/pcp/pmdas/unifi/Install ]; then
            cd /var/lib/pcp/pmdas/unifi && ./Install -u </dev/null >/dev/null 2>&1 || true
        fi
        ;;
    abort-upgrade|abort-remove|abort-deconfigure)
        ;;
    *)
        echo "postinst called with unknown argument '$1'" >&2
        exit 1
        ;;
esac

#DEBHELPER#

exit 0
