Created
September 9, 2015 12:30
-
-
Save mattanja/8a2169852b2f75f3f448 to your computer and use it in GitHub Desktop.
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 | |
# | |
# (c) 2007 Mattanja Kern <mattanjakern.de> | |
# | |
#USAGE="Usage: mkchmod" | |
USAGE="Usage: mkchmod [dirmode [filemode]]" | |
if [ "$1" = "" ] ; then | |
echo $USAGE | |
DIRMODE="u=rwx,g=rwxs,o-rwx" | |
else | |
DIRMODE=$1 | |
fi | |
if [ "$2" = "" ] ; then | |
echo $USAGE | |
FILEMODE="u+rwX,g+rwX,o-rwx" | |
else | |
FILEMODE=$2 | |
fi | |
#DIRMODE=770 | |
#FILEMODE=$2 | |
echo find ./ -type d -exec chmod "$DIRMODE" {} \; | |
find ./ -type d -exec chmod "$DIRMODE" {} \; # chmod 755 /blah | |
#echo find ./ -type f -perm +111 -exec chmod 111 {} \; | |
echo find ./ -type f -exec chmod "$FILEMODE" {} \; | |
find ./ -type f -exec chmod "$FILEMODE" {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment