Admin/website/build/set_perm.bash
author urbanc
Mon, 05 Dec 2005 10:33:30 +0100
changeset 18352 b9d0bd76286c
parent 17752 a92cda068ad8
permissions -rwxr-xr-x
tuned

#!/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