Created
January 8, 2013 21:15
-
-
Save ubermuda/4488007 to your computer and use it in GitHub Desktop.
sets permissions on a symfony's cache and logs directories for both your user and the apache/httpd user
This file contains hidden or 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/bash | |
| function detect_apache_user { | |
| ps axho user,comm | grep -E "apache|httpd" | grep -v root | uniq | awk 'END { print $1 }' | |
| } | |
| APACHE_USER=$( detect_apache_user ) | |
| USER=$( whoami ) | |
| echo "Allowing apache user '$APACHE_USER' and user '$USER'" | |
| chmod +a "$( detect_apache_user ) allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs | |
| chmod +a "$( whoami ) allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment