#! /bin/sh

set -e

dpkg --assert-support-predepends

if [ "$1" = "upgrade" -a -f /etc/init.d/syslog-ng ]; then
    if [ -f /etc/init.d/syslog-ng ]
    then
	set +e
	sh /etc/init.d/syslog-ng stop
	set -e
    fi
fi

if [ "$1" = "install" ]; then
    dpkg-divert --package syslog-ng --add --rename \
        --divert /etc/init.d/sysklogd.syslog-ng /etc/init.d/sysklogd
fi

#DEBHELPER#

exit 0
