if [ -z "$1" ]
then
echo "use: change.perms cpanel_user";
exit;
fi
HomeDirectories[0]="/home/$1"
# HomeDirectories[1]="/home2/$1"
# HomeDirectories[2]="/home3/$1"
export IFS=$'n'
for x in ${HomeDirectories[@]}
do
if [ -h "$x" ]; then
echo "Leaving $x because is symlink..."
else
z="$x/public_html"
for i in $( find $z -type d )
do
if [ "$z" != "$i" ]
then
chmod -c 755 $i
chown -c $1:$1 $i
fi
done
for i in $( find $z -type f )
do
chmod -c 644 $i
chown -c $1:$1 $i
done
for i in $( find $z -type f |grep configure.php)
do
chmod -c 444 $i
done
for i in $( find $z -type f |grep configuration.php)
do
chmod -c 444 $i
done
fi
done
echo "Done."