#!/bin/sh

set -e

case "$1" in
    configure)
        if command -v dictdconfig > /dev/null 2>&1 # update dictd's DB
        then
            dictdconfig -w
        fi
        # Reload a running server without starting a stopped service.
        if dpkg -s dictd 2> /dev/null | grep -qx 'Status: install ok installed' &&
            invoke-rc.d dictd status > /dev/null 2>&1
        then
            invoke-rc.d dictd reload
        fi
    ;;

    failed-upgrade|abort-upgrade|abort-remove|abort-deconfigure|in-favour|removing)

    ;;

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

#DEBHELPER#

exit 0
