#!/bin/sh

#DEBHELPER#

set -e

case "$1" in
    configure)
	if [ ! -d /var/log/cipux-cat-web ]; then
		mkdir -p /var/log/cipux-cat-web
	fi
	chown -R www-data:www-data /var/log/cipux-cat-web
	chmod 750 /var/log/cipux-cat-web
	if [ ! -d /etc/cipux-cat-web ]; then
		mkdir -p /etc/cipux-cat-web
	fi
	chmod 750 /etc/cipux-cat-web
	# Admins may have copied this file from /usr/share/...
	# Correcting permissions if existent
	[ -f /etc/cipux-cat-web/cipux-cat-web.conf ] && \
		chmod 640 /etc/cipux-cat-web/cipux-cat-web.conf
	chown -R www-data:www-data /etc/cipux-cat-web
	;;
    abort-upgrade|abort-remove|abort-deconfigure)
	;;
    *)
	echo "postinst called with unknown argument \`$1'" >&2
	exit 1
	;;
esac

exit 0
