Last active
January 11, 2018 19:36
-
-
Save CatEntangler/3e753b07506db641661f to your computer and use it in GitHub Desktop.
WordPress with Git Permissions updater shell file
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 | |
username="WEBSERVERUSER" | |
adminuser="ADMINISTRATIVEUSER" | |
group="ADMINISTRATIVEGROUP" | |
sudo chown ${username}:${group} -R . | |
sudo find . -type d -exec chmod 570 {} \; | |
sudo find . -type f -exec chmod 470 {} \; | |
sudo chown ${adminuser}:${group} .permissions.sh | |
sudo chown ${adminuser}:${group} -R .git | |
sudo chmod 770 .permissions.sh | |
sudo chmod 770 -R .git | |
sudo chmod 770 -R wp-content/uploads | |
sudo chmod 770 -R wp-content/cache | |
sudo chmod 770 wp-content/wp-cache-config.php | |
sudo chmod 770 wp-content/advanced-cache.php | |
sudo chmod 770 wp-content/debug.log |
Changed name to .permissions.sh in my setups. permissions updates now includes this.
Updated to be default WordPress setup compliant (will need to throw Maje's content directory one somewhere else).
Removed the initial change everything to 470 because that potentially breaks directory execution
Changed the order of things for aesthetic/readability reasons.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Place in the WordPress root directory.