#!/bin/sh
set -e

# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
	set -- apache2-foreground "$@"
fi

echo "updating permissions"
find /var/www/html -not -user www-data -execdir chown www-data:www-data {} \+

exec "$@"