#!/usr/bin/env bash

if [ -z "$1" ]; then
    echo "Vous devez ajouter en paramètre le nom de l'utilisateur à appliquer aux dossiers"
else
sudo chown $1:www-data . -R

sudo chown $1:www-data frontend/runtime/ -R
sudo chmod 775 frontend/runtime/ -R

sudo chown $1:www-data frontend/web/assets/ -R
sudo chmod 775 frontend/web/assets/ -R

sudo chown $1:www-data backend/runtime/ -R
sudo chmod 775 backend/runtime/ -R

sudo chown $1:www-data backend/web/assets/ -R
sudo chmod 775 backend/web/assets/ -R

sudo chown $1:www-data producer/runtime/ -R
sudo chmod 775 producer/runtime/ -R

sudo chown $1:www-data producer/web/assets/ -R
sudo chmod 775 producer/web/assets/ -R

fi

