Long time searching this script, and I found it!!
The author is:
http://bsd-crew.de/index.php/Chmod-Script_mit_Directory_und_File_UnterscheidungWith this script you can change recursively files and directorys to any diferent permission.
Usage: chmodr fff ddd [pfad]
fff ... chmod argument for files (644)
ddd ... chmod argument for direcories (755)
pfad ... nothing for current directory
Example: chmodr 644 755 for currently directory
or
chmod 644 755 /home/e-smith/files/ibays/Primary/html/store for specyfic directory.
Ofcourse, you can chmodr 664 777, etc
Make this script with mcedit and save as "chmodr". Open "mcedit, and paste the code with "shift+insert". Save with F2. Change owner to root.root and chmoded to 755. Then copy to /usr/bin directory.
#!/bin/sh
# recursive chmod with arguments for files and directories
# save internal field separator
IFS_save=$IFS
# set internal field separator, thx to matthias
IFS=$'
'
# read arguments
chmodf=$1 # chmod for files
chmodd=$2 # chmod for directories
dir=$3 # start directory
# test for arguments $1 and $2
if [ -z "$chmodf" -o -z "$chmodd" ]
then
echo "Usage: `basename $0` fff ddd [pfad]"
echo " fff ... chmod argument for files (644)"
echo " ddd ... chmod argument for direcories (755)"
echo " pfad ... nothing for current directory"
exit
fi
# if no start directory, use current directory
if [ -z "$dir" ]
then
dir="."
fi
# "\$x='$x'"
# find backwards all files and directories
for file in `find "$dir" -name "*"`
do
# debug print
# echo "$file"
if [ -d $file ] # directory
then
# chmod
chmod $chmodd $file
elif [ -e $file ] # file
then
# chmod
chmod $chmodf $file
else
echo "error: $file"
fi
done
#set back internal field separator
IFS=$IFS_sav
Enjoy
Normando