#!/bin/sh
[ -s conf ] && . ./conf

: ${ROOTDIR:=/srv/www/monkey}
: ${LOGDIR:=/var/log/monkey}

if [ ! -d $ROOTDIR ]; then
	mkdir -p $ROOTDIR
	chown _monkey:_monkey $ROOTDIR
fi
if [ ! -d $LOGDIR ]; then
	mkdir -p $LOGDIR/htdocs
	chown _monkey:_monkey -R $LOGDIR
fi

exec chpst -u monkey:monkey monkey
