#! /bin/sh

set -e

if [ "$1" = "configure" ]
then

    case $2 in
    1.4.1-18|1.4.1-19|1.4.1-20|1.4.1-21|1.5-1)
        chmod 644 /etc/default/klogd
        ;;
    esac

    if [ -f /etc/init.d/klogd -a -n "$2" ]
    then
	set +e
	if [ -x /usr/sbin/invoke-rc.d ]
	then
	    invoke-rc.d klogd stop
	else
	    sh /etc/init.d/klogd stop
	fi
	set -e
    fi

    update-rc.d klogd defaults 11 89 >/dev/null

    # restarting daemon
    #
    if [ -f /etc/init.d/klogd ]
    then
	set +e
	if [ -x /usr/sbin/invoke-rc.d ]
	then
	    invoke-rc.d klogd start
	else
	    sh /etc/init.d/klogd start
	fi
	set -e
    fi
fi

exit 0
