Created
October 12, 2011 22:45
-
-
Save j/1282868 to your computer and use it in GitHub Desktop.
Symfony2 permission setup
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
#!/bin/sh | |
## SYMFONY ENVIRONMENT PERMISSION SETUP -- Run in root directory of application ## | |
# Set file and folder permissions | |
echo -e "Setting global file and folder permissions... " | |
find . -type d -print0 | xargs -0 chmod 0775 | |
find . -type f -print0 | xargs -0 chmod 0664 | |
echo -e "done!\n" | |
# Set acl on cache | |
DIRECTORIES="./app/cache ./app/logs" | |
for dir in $DIRECTORIES | |
do | |
echo -e "Checking if $dir exists... " | |
if [ -d $dir ]; | |
then | |
setfacl -R -m u:apache:rwx -m u:$USER:rwx $dir | |
setfacl -dR -m u:apache:rwx -m u:$USER:rwx $dir | |
message="set acl." | |
else | |
message="does not exist." | |
fi | |
echo -ne "$message\n\n" | |
done | |
echo -e "...... done!" | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment