#!/bin/bash # for each domain directory for i in `ls /home/httpd/vhosts|grep '\.'` do # get the username for the directory user=`ls -ld /home/httpd/vhosts/$i/httpdocs|awk {'print $3'}` # set up the acls echo "Setting file acls for $user on $i/httpdocs" setfacl -m u:$user:rwx -R /home/httpd/vhosts/$i/httpdocs setfacl -d -m u:$user:rwx -R /home/httpd/vhosts/$i/httpdocs echo "Setting file acls for $user on $i/httpsdocs" setfacl -m u:$user:rwx -R /home/httpd/vhosts/$i/httpsdocs setfacl -d -m u:$user:rwx -R /home/httpd/vhosts/$i/httpsdocs # profit done