#!/bin/sh

USER=imip-agent
GROUP=lmtp
INSTALL_DIR=/var/lib/imip-agent
WEB_INSTALL_DIR=/var/www/imip-agent

chown -R "$USER" "$INSTALL_DIR"
chgrp -R "$GROUP" "$INSTALL_DIR"

for DIR in "$INSTALL_DIR"/store "$INSTALL_DIR"/preferences "$WEB_INSTALL_DIR"/static ; do
    chown -R "$USER" "$DIR"
    chgrp -R "$GROUP" "$DIR"
    chmod -R g+w "$DIR"
done
