#! /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 root {} \; -exec chgrp root {} \; -exec chmod o+rw {} \; \( -perm 0777 -o -perm 0775 -o -perm 0770 -o -perm 0757 -o -perm 0755 -o -perm 0750 -o -perm 0700 \) -exec chmod 0777 {} \;
chmod 0777 $FXHOME/act/act.dbs
chmod 0777 $FXHOME/act/bin
chmod 0777 $FXHOME/act/defaults 
chmod 0666 $FXHOME/act/defaults/* 
chmod 0777 $FXHOME/act/help 
chmod 0777 $FXHOME/act/qryflex
chmod 0777 actd
chmod 0777 acta
chmod 0777 actm
chmod 0777 actflex
fi

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

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

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

# if test -d /home/gerard; then
#     echo "HOME DIRECTORY"
#     find /home/gerard -exec chown root {} \; -exec chgrp root {} \; -exec chmod o+rw {} \; \( -perm 0777 -o -perm 0775 -o -perm 0770 -o -perm 0757 -o -perm 0755 -o -perm 0750 -o -perm 0700 \) -exec chmod 0777 {} \;
# fi
