Skip to content

Instantly share code, notes, and snippets.

@abteilung
Created April 25, 2013 13:14
Show Gist options
  • Save abteilung/5459597 to your computer and use it in GitHub Desktop.
Save abteilung/5459597 to your computer and use it in GitHub Desktop.
chmod -r und chown-r für CYON-Server
#!/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