Created
July 21, 2013 20:34
-
-
Save reening/6049870 to your computer and use it in GitHub Desktop.
Quick fix for file permissions in my media folder.
This file contains hidden or 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 | |
DIR=/home/martijn/Music | |
if [[ $EUID -ne 0 ]]; then | |
echo "Only root can run this script." 2>&1 | |
exit 1 | |
else | |
find $DIR -type d -print0 | xargs -0 chmod 0755 | |
find $DIR -type f -print0 | xargs -0 chmod 0644 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment