Skip to content

Instantly share code, notes, and snippets.

@j
Created October 12, 2011 22:45
Show Gist options
  • Save j/1282868 to your computer and use it in GitHub Desktop.
Save j/1282868 to your computer and use it in GitHub Desktop.
Symfony2 permission setup
#!/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