Plesk ACL script

pleskacl.sh

#!/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

For more info see http://transcendlinux.com/resolving-issues-with-content-created-by-apache-php

Submitted by jkelly on Sat, 2006-09-23 04:04. categories [ | ] login or register to post comments