#! /bin/sh

#FXHOME=$HOME; export FXHOME
cd ..
cd ..
FXHOME=`pwd`; export FXHOME
cd act/bin

if test -d $FXHOME/act; then
echo "ACCOUNTFLEX PERMISSIONS BEING SET ..."
find $FXHOME/act -exec chown infoflex {} \; -exec chgrp infoflex {} \; -exec chmod o-rwx {} \; \( -perm 0777 -o -perm 0775 -o -perm 0770 -o -perm 0757 -o -perm 0755 -o -perm 0750 -o -perm 0700 \) -exec chmod 0755 {} \;
chmod 0777 $FXHOME/act/defaults 
chmod 0666 $FXHOME/act/defaults/* 
chmod 0777 $FXHOME/act/help 
chmod 0777 $FXHOME/act/qryflex
chmod 0666 $FXHOME/act/qryflex/qryflex.map
chmod 0755 actd
chmod 0755 acttest
chmod 0755 actcopy
chmod 0755 actflex
chmod u+s,g+s actflex 

touch $FXHOME/act/act.dbs/batchlog
chmod 0666 $FXHOME/act/act.dbs/batchlog
touch $FXHOME/act/act.dbs/cclog
chmod 0666 $FXHOME/act/act.dbs/cclog

if test -d $FXHOME/act/acttest.dbs; then
   touch $FXHOME/act/acttest.dbs/batchlog
   chmod 0666 $FXHOME/act/acttest.dbs/batchlog
   touch $FXHOME/act/acttest.dbs/cclog
   chmod 0666 $FXHOME/act/acttest.dbs/cclog
   fi
fi

if test -d $FXHOME/fx; then
    echo "INFOFLEX-4GL PERMISSIONS BEING SET ..."
    find $FXHOME/fx -exec chown infoflex {} \;  -exec chgrp infoflex {} \; -exec chmod o-rwx {} \; \( -perm 0777 -o -perm 0775 -o -perm 0770 -o -perm 0757 -o -perm 0755 -o -perm 0750 -o -perm 0700 \) -exec chmod 0755 {} \;
fi

if test -d $FXHOME/qryflex; then
    echo "QUERYFLEX PERMISSIONS BEING SET ..."
    find $FXHOME/qryflex -exec chown infoflex {} \; -exec chgrp infoflex {} \; -exec chmod o-rwx {} \; \( -perm 0777 -o -perm 0775 -o -perm 0770 -o -perm 0757 -o -perm 0755 -o -perm 0750 -o -perm 0700 \) -exec chmod 0755 {} \;
fi

if test -d $FXHOME/sqlflex; then
    echo "SQLFLEX PERMISSIONS BEING SET ..."
    find $FXHOME/sqlflex -exec chown infoflex {} \; -exec chgrp infoflex {} \; -exec chmod o-rwx {} \; \( -perm 0777 -o -perm 0775 -o -perm 0770 -o -perm 0757 -o -perm 0755 -o -perm 0750 -o -perm 0700 \) -exec chmod 0755 {} \;
fi
