#!/bin/sh

if [ "${2}" != "POST-INSTALL" ]; then
	exit 0
fi

if [ ! -f /cf/conf/config.xml ]; then
	cp /conf.default/config.xml /cf/conf/config.xml
fi

if [ ! -L /conf ]; then
	ln -sf /cf/conf /conf
fi

if [ ! -d /cf/conf/backup ]; then
	mkdir /cf/conf/backup
fi

FLAVOR="%%FLAVOR%%"
echo ${FLAVOR##-} > /etc/default-config-flavor

exit 0
