Last active
August 29, 2015 14:00
-
-
Save smcelhinney/11288301 to your computer and use it in GitHub Desktop.
Recursive bash directory permissions for Apache vhosts.
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
dir=/home/somevhostdomain.com/htdocs/; | |
while true; do | |
# the exit case when we get to the top level directory / | |
if [ -z "$dir" -o "$dir" = "/" ]; then | |
break; | |
fi; | |
echo chmodding o+x $dir; | |
# make the directory exectuable (openable) by others | |
chmod o+x $dir; | |
# go 'up' a directory | |
dir=`dirname $dir`; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment