#!/bin/sh

set -e


case "$1" in
	configure|reconfigure)
		if [ ! -d /etc/vlmcsd/ ]; then
			mkdir -p /etc/vlmcsd/
		fi
		if [ ! -d /var/log/vlmcsd/ ]; then
			mkdir -p /var/log/vlmcsd/
			chown -R vlmcsd:vlmcsd /var/log/vlmcsd
		fi
		if [ ! -f /etc/vlmcsd/vlmcsd.ini ]; then
			cp /usr/share/vlmcsd/vlmcsd.ini /etc/vlmcsd/
		fi
		if [ ! -f /etc/vlmcsd/vlmcsd.kmd ]; then
			cp /usr/share/vlmcsd/vlmcsd.kmd /etc/vlmcsd/
		fi
		;;
	abort-upgrade|abort-remove|abort-deconfigure)
		exit 0
		;;
	*)
		echo "postinst called with unknown argument \`$1'" >&2
		exit 0
		;;
esac

#DEBHELPER#

exit 0
