Admin/website/build/set_perm.bash
author haftmann
Tue, 04 Oct 2005 14:58:44 +0200
changeset 17752 a92cda068ad8
parent 17751 2cc8429943f2
permissions -rwxr-xr-x
added redirect.html

#!/usr/bin/env bash
# $Id$

# set permissions for local files

# parameters
FIND="$1"
LOCAL_UMASK_FILE="$2"
LOCAL_UMASK_DIR="$3"
LOCAL_GROUP="$4"

for file in $("$FIND" .)
do
    if [ -O "$file" ]
    then
        echo "$file..."
        if [ -d "$file" ]
        then
            chmod "$LOCAL_UMASK_DIR" "$file"
        else
            if [ -x "$file" ]
            then
                chmod "$LOCAL_UMASK_FILE",u+x,g+x "$file"
            else
                chmod "$LOCAL_UMASK_FILE" "$file"
            fi
        fi
        chgrp "$LOCAL_GROUP" "$file"
    fi
done