#!/bin/bash
# set up owner, group and permissions for system or user directories (2nd parameter)
OWNER=root
GROUP=admin
DIRMOD=16893 # drwxrwxr-x
EXEMOD=33277 # -rwxrwxr-x
LINKMOD=41469 # lrwxrwxr-x
FILEMOD=33204 # -rw-rw-r--
# recursive survey of directory:
# ignore cvs, svn and Finder crap
# choose file mode depending on what kind of file we got
survey ()
{
for file in `ls -1A $1`
do
case $file in
CVS | .svn | .cvsignore | .cvspass | .DS_Store )
;;
* )
if [ -d "$1/$file" ]
then
echo ""
survey "$1/$file"
echo "mode"
echo ""
elif [ -x "$1/$file" ]
then
echo ""
echo "mode"
echo ""
elif [ -L "$1/$file" ]
then
echo ""
echo "mode"
echo ""
else
echo ""
echo "mode"
echo ""
fi
;;
esac
done
}
# output root XML and top directory, then recursively survey the directories
echo ""
echo ""
echo ""
survey "$1"
echo "mode"
echo ""
echo ""