Skip to content

Instantly share code, notes, and snippets.

@kyleskrinak
Created February 11, 2014 02:34
Show Gist options
  • Save kyleskrinak/8928288 to your computer and use it in GitHub Desktop.
Save kyleskrinak/8928288 to your computer and use it in GitHub Desktop.
A brutishly simple shell script that fixes drupal shared permissions (if you have shell access)
if [ -d "$1/sites" ]; then
cur_dir=`pwd`
echo $cur_dir
cd $1
echo `pwd`
echo "chmod directories"
find . -type d -exec chmod u=rwx,g=rx,o=rx {} \;
echo "chmod files"
find . -type f -exec chmod u=rw,g=r,o=r {} \;
echo "chmod sites/default/files"
chmod -R o+w sites/default/files
echo "chmod for bam"
chmod -R g+w sites/default/files/private/backup_migrate/
cd $cur_dir
echo `pwd`
else
echo "give me a valid directory, man!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment