#!/bin/bash
#

#for I in `find /home/ftpusers -type d` ; do chmod 777 “$I” ; done
#for X in `find /home/ftpusers -type f` ; do chmod 666 “$X” ; done

#find /home/ftpusers/ftpcba -type d -path’/toclient’ > dir.txt
#find /home/ftpusers/ftpcba -type d \( -name toclient -o -name fromclient \) -prune > dir.txt
#find /home/ftpusers -type d > dir.txt
find /home/ftpusers/ftpcba -type d -fprint dir.txt
#find /home/ftpusers -type f > file.txt
find /home/ftpusers/ftpcba -type f -fprint file.txt
#find /home/ftpusers/ftpcba -type f \( -name toclient -o -name fromclient \) -prune > file.txt

cat dir.txt | grep -i -e “toclient” -e “fromclient” | while read THISLINE
do
echo “chmod on dir $THISLINE”
# chmod 777 “$THISLINE”
done

cat file.txt | grep -i -e “toclient” -e “fromclient” | while read THISLINE
do
echo “chmod on file $THISLINE”
# chmod 666 “$THISLINE”
done

#chgrp -R ftpadmin /home/ftpusers
chmod -R u-r /home/ftpusers/angscan
chmod -R u-r /home/ftpusers/devangscan
chmod 577 /home/ftpusers/ftpjms/
chmod 777 /home/ftpusers/ftpjms/toclient/cba/

Advertisements