#!/bin/bash
#

if [ "$1" = "settings" ]; then
    univention-app reinitialize benno-mailarchiv
fi

if [ "$1" = "settings" -o "$1" = "install" -o "$1" = "upgrade" ]; then
    univention-app shell benno-mailarchiv chgrp www-data /etc/machine.secret
    univention-app shell benno-mailarchiv chmod 0440 /etc/machine.secret
    univention-app shell benno-mailarchiv /docker-local/environment2config -v -t /docker-local/ucs
    univention-app shell benno-mailarchiv [ -L /etc/benno-web/auth.d/50_benno_dbauth ] && /bin/rm -f /etc/benno-web/auth.d/50_benno_dbauth
fi

exit 0