Last active
December 15, 2015 20:59
-
-
Save m4s0/937243d67183ea21ec09 to your computer and use it in GitHub Desktop.
Symfony 2.* init permissions folders
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` | |
FOLDERS="app/cache app/logs app/sessions" | |
sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX $FOLDERS | |
sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX $FOLDERS | |
sudo chown -R `whoami`:`whoami` $FOLDERS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment