#!/bin/sh

LOCAL_CONFIG_FILES="apt_no_repo_accept apt_reject libs.local.yaml zombies_ignore"

set -e

case $1 in
	configure)
		# Move configuration files which are recognized, but
		# not shipped by default and hence are not conffiles.
		# See README.Debian.
		if [ -d /etc/hobbit/ ]; then
                    for f in $LOCAL_CONFIG_FILES; do
                        if [ -e /etc/hobbit/$f -a ! -e /etc/xymon/$f ]; then
                            mv -v /etc/hobbit/$f /etc/xymon/$f
                        fi
                    done
                fi

		if test -x /usr/lib/xymon/server/bin/xymond ; then
			if [ -x /usr/sbin/invoke-rc.d ] ; then
				invoke-rc.d xymon reload || :
			else
				/etc/init.d/xymon reload || :
			fi
		else
			if [ -x /usr/sbin/invoke-rc.d ] ; then
				invoke-rc.d xymon-client reload || :
			else
				/etc/init.d/xymon-client reload || :
			fi
		fi
		;;
esac

#DEBHELPER#

exit 0
