Created
November 16, 2012 18:27
-
-
Save davidosomething/4089660 to your computer and use it in GitHub Desktop.
BASH script to fix permissions of OSX Sites folder
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 | |
cd /Users/dotrakoun/Sites | |
# fix owner | |
echo "Fixing ownership of /Users/dotrakoun/Sites" | |
sudo chown -R dotrakoun:www /Users/dotrakoun/Sites | |
# fix file perms | |
echo "Fixing file permissions of /Users/dotrakoun/Sites" | |
chmod -R ug+rw /Users/dotrakoun/Sites | |
# fix dir perms | |
echo "Removing all execute permissions of all files" | |
find . -type f -exec chmod -xs {} \; | |
echo "Adding user-only execute permissions to shell scripts" | |
find . -type f -name "*.sh" -exec chmod u+x {} \; | |
echo "Adding user-only execute permissions to git hooks" | |
find . -type f -regex ".*\.git/hooks/.*" -exec chmod u+x {} \; | |
echo "Fixing dir permissions of /Users/dotrakoun/Sites" | |
find . -type d -exec chmod ug+rws {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment