Last active
August 29, 2015 13:56
-
-
Save taddev/8809515 to your computer and use it in GitHub Desktop.
A series of scripts to manage the permissions for various wordpress directories in bulk. The *lock* scripts will remove write access to the files while the *unlock* scripts will add it.
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 | |
LOCKFILE="/home/tad/scripts/.unlocked_wp-content" | |
WPDIR="/var/www/localhost/htdocs/blog/wp/wp-content" | |
if [ -f $LOCKFILE ]; then | |
echo "Locking WP-Content Directory" | |
find $WPDIR -type f -exec chmod 644 {} \; | |
find $WPDIR -type d -exec chmod 755 {} \; | |
rm -f $LOCKFILE | |
else | |
echo "WP-Content Directory Already Locked" | |
fi |
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 | |
LOCKFILE="/home/tad/scripts/.unlocked_wp-content" | |
WPDIR="/var/www/localhost/htdocs/blog/wp/wp-content" | |
if [ ! -f $LOCKFILE ]; then | |
echo "Unlocking WP-Content Directory" | |
find $WPDIR -type f -exec chmod 664 {} \; | |
find $WPDIR -type d -exec chmod 775 {} \; | |
touch $LOCKFILE | |
else | |
echo "WP-Content Directory Already Unlocked" | |
fi |
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 | |
LOCKFILE="/home/tad/scripts/.unlocked_wp-content" | |
WPDIR="/var/www/localhost/htdocs/blog/wp/wp-content" | |
if [ ! -f $LOCKFILE ]; then | |
echo "Unlocking WP-Content Directory" | |
find $WPDIR -type f -exec chmod 664 {} \; | |
find $WPDIR -type d -exec chmod 775 {} \; | |
touch $LOCKFILE | |
else | |
echo "WP-Content Directory Already Unlocked" | |
fi |
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 | |
LOCKFILE="/home/tad/scripts/.unlocked_wp" | |
LOCKCONTENT="/home/tad/scripts/.unlocked_wp-content" | |
WPDIR="/var/www/localhost/htdocs/blog/wp/" | |
if [ ! -f $LOCKFILE ]; then | |
echo "Unlocking WP Directory" | |
find $WPDIR -type f -exec chmod 664 {} \; | |
find $WPDIR -type d -exec chmod 775 {} \; | |
touch $LOCKFILE | |
if [ ! -f $LOCKCONTENT ]; then | |
touch $LOCKCONTENT | |
fi | |
else | |
echo "WP Directory Already Unlocked" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment