New ResetFTP Script
/#!/bin/bash
#
echo "Starting directory find..."
find /home/ftpusers -type d -fprint dir.txt
echo "Ending directory find."
echo "Starting file find..."
find /home/ftpusers -type f -fprint file.txt
echo "Ending file find."
echo "Starting directory chmod..."
cat dir.txt | grep -i -e "toclient" -e "fromclient" | while read THISLINE
do
echo "chmod on dir $THISLINE"
chmod 770 "$THISLINE"
chgrp ftpusers "$THISLINE"
done
echo "Ending directory chmod."
echo "Starting file chmod..."
cat file.txt | grep -i -e "toclient" -e "fromclient" | while read THISLINE
do
echo "chmod on file $THISLINE"
chmod 660 "$THISLINE"
chgrp ftpusers "$THISLINE"
done
echo "Ending file chmod."
echo "Starting misc rights changes..."
#This is set on scan to prevent client from veiwing directory listings.
chmod -R u-r /home/ftpusers/angscan
chmod -R u-r /home/ftpusers/devangscan
#This is set on jms to prevent them from writing to the root of their ftp.
chmod 577 /home/ftpusers/ftpjms/
echo "Ending misc rights changes."