Last active
April 18, 2018 14:15
-
-
Save georgedobre/89efcf10f4ccac48f15e20f33c67f330 to your computer and use it in GitHub Desktop.
fixMagento.sh
This file contains 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 | |
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