Skip to content

Instantly share code, notes, and snippets.

@georgedobre
Last active April 18, 2018 14:15
Show Gist options
  • Save georgedobre/89efcf10f4ccac48f15e20f33c67f330 to your computer and use it in GitHub Desktop.
Save georgedobre/89efcf10f4ccac48f15e20f33c67f330 to your computer and use it in GitHub Desktop.
fixMagento.sh
#!/bin/bash
blue=$(tput setaf 4)
normal=$(tput sgr0)
red=$(tput setb 1 setaf 1)
echo "==============================="
echo "=== FIX MAGENTO PERMISSIONS ==="
echo "==============================="
if [ "bin/magento" ]
then
bin/magento cache:clean;
echo "$red Please make sure you are in your Magento root folder if not press CTRL + C now! $normal"
echo "===================================="
read -p "Enter username: " username
chown $username:$username -R var/cache/*;
chown $username:$username -R generated/*;
echo "Done."
else
echo "Please move this script into Magento root folder!"
echo "Don't forget to run chmod +x fixMagento.sh before running ./fixMagento.sh"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment