Last active
January 1, 2016 09:59
-
-
Save jstrosch/8128531 to your computer and use it in GitHub Desktop.
Script to set proper file permissions on a drupal installation.
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 | |
echo "Type the directory from /var/www, followed by [ENTER]:" | |
read dir | |
cd /var/www/$dir | |
echo "Updating owners..." | |
#TODO: change | |
#chown -R #:www-data . | |
find . -type d -exec chmod u=rwx,g=rx,o= {} \; | |
find . -type f -exec chmod u=rw,g=r,o= {} \; | |
cd sites | |
echo "Changed to:" | |
pwd | |
find . -type d -name files -exec chmod ug=rwx,o= '{}' \; | |
find . -name files -type d -exec find '{}' -type f \; | while read FILE; do chmod ug=rw,o= "$FILE"; done | |
find . -name files -type d -exec find '{}' -type d \; | while read DIR; do chmod ug=rwx,o= "$DIR"; done | |
echo "Permissions Updated!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment