#!/bin/sh

set -e

fix_permissions() {
	chown -R www-data:adm /var/log/roundcubemail
	chown -R root:www-data /etc/roundcubemail
	find /etc/roundcubemail -type d -exec chmod u+rwx,g+rx,g-w,o-rwx {} \;
	find /etc/roundcubemail -type f -exec chmod u+rw,u-x,g+r,g-wx,o-rwx {} \;
}

case $1 in
	*)
		fix_permissions
	;;
esac

#DEBHELPER#
