Skip to content

Instantly share code, notes, and snippets.

@dzungtran
Last active August 29, 2015 14:21
Show Gist options
  • Save dzungtran/33aac2e20826a34964cb to your computer and use it in GitHub Desktop.
Save dzungtran/33aac2e20826a34964cb to your computer and use it in GitHub Desktop.
Magento reset files mode
#!/bin/bash
if [ ! -f ./app/etc/local.xml ]; then
echo "-- ERROR"
echo "-- This doesn't look like a Magento install. Please make sure"
echo "-- that you are running this from the Magento main doc root dir"
exit
fi
if [ `id -u` != 0 ]; then
echo "-- ERROR"
echo "-- This script should be run as root so that file ownership"
echo "-- changes can be set correctly"
exit
fi
find . -type f \-exec chmod 644 {} \;
find . -type d \-exec chmod 755 {} \;
find ./var -type d \-exec chmod 777 {} \;
find ./var -type f \-exec chmod 666 {} \;
find ./media -type d \-exec chmod 777 {} \;
find ./media -type f \-exec chmod 666 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment