#!/bin/sh  
# \
  exec oagtclsh "$0" "$@"

# $Log: not supported by cvs2svn $
# Revision 1.1  2004/07/23 14:38:16  shang
# modified setfacl proc to tcltklib and modifed setFACL-oagPlu in /home/helios/OAG/bin/
# to call the libary procedure - APSSetFACL
#

set CVSRevisionAuthor "\$Revision: 1.2 $ \$Author: shang $"

set auto_path [linsert $auto_path 0  /usr/local/oag/apps/lib/$env(HOST_ARCH)]
set auto_path [linsert $auto_path 0 /usr/local/oag/lib_patch/$env(HOST_ARCH)]
APSStandardSetup

set usage "usage: setFACL-oagPlus <usernames> <filename> ...\n<usernames> is a comma-separated list"
if ![llength $argv] {
    puts stderr "$usage"
    exit
}
set userList [split [lindex $argv 0] ,]
set filenameList [lrange $argv 1 end]
foreach item $filenameList {
    if ![file exists $item] {
        puts stderr "$item not found"
        exit
    }
}

if [catch {APSSetFACL -userList $userList -filenameList $filenameList} result] {
    puts stderr $result
    exit
}

exit