Last active
August 29, 2015 14:06
-
-
Save devsli/053f36c20d0bbb6e44a9 to your computer and use it in GitHub Desktop.
Recursive site permissions set
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/sh | |
if [ "$1" = "" ]; then | |
echo "usage: $0 website-dir"; | |
echo; | |
# echo "Set owner of <website-dir> to www:nogroup,"; | |
echo "Set permissions rw-r-r for regular files"; | |
echo "and rwx-rx-rx for directories"; | |
echo; | |
echo "Root permissions might be required."; | |
exit 1; | |
fi; | |
if [ ! -d $1 ]; then | |
echo "$1: is not a directory"; | |
exit 1; | |
fi; | |
# chown -R www:nogroup $1 | |
# chown -R apache:apache $1 | |
find $1 -type d -exec chmod 755 {} \; | |
find $1 -type f -exec chmod 644 {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment