Created
April 25, 2013 13:14
-
-
Save abteilung/5459597 to your computer and use it in GitHub Desktop.
chmod -r und chown-r für CYON-Server
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 | |
# | |
# @author "cyon GmbH" <mail@cyon.ch> | |
# @version 0.1 | |
## PATH Setzen nicht vergessen! | |
Path='/home/[BENUTZERNAME]/[PFAD]/' | |
function setChmod { | |
ls -1 $1 | while read file | |
do | |
file=${1}/${file} | |
if [[ -f $file ]] && [[ `stat -c %a $file` != 644 ]] | |
then | |
chmod 644 $file | |
elif [[ -d $file ]] | |
then | |
chmod 755 $file && setChmod $file | |
fi | |
done | |
} | |
setChmod $Path | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment