Skip to content

Instantly share code, notes, and snippets.

@scottalan
Created August 18, 2016 02:52
Show Gist options
  • Save scottalan/f71c4a2f644a572219487b92063f9ec5 to your computer and use it in GitHub Desktop.
Save scottalan/f71c4a2f644a572219487b92063f9ec5 to your computer and use it in GitHub Desktop.
Alias: Fix file permissions (Drupal)
fixfiles() {
# Drupal root.
drupal=$(drush dd)
retval=$?
echo "${retval}"
if [ $? -eq 0 ]; then
echo OK
else
echo FAIL
fi
echo "${drupal}"
# Files directory.
file_dir="$drupal/sites/default/files";
# Set permissions.
sudo find $file_dir -type d -exec chmod 775 {} +;
sudo find $file_dir -type f -exec chmod 664 {} +;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment