zEitEr
Super Moderator
In that lines, there's nothing that would change owner of logs dir.
But this changes all directory's to user:user, I only need the logs directory to be changed and I'm no good with grep./home | grep '^d' | awk '{system("chown -R " $3 ":" $4 " /home/" $4 "/domains")}'
for username in `ls -1 /usr/home/`;
do
if [ -d "/usr/home/${username}/domains/" ]; then
chmod 750 /usr/home/${username}/domains/*/logs/
chown root:${username} /usr/home/${username}/domains/*/logs/
fi;
done;
ls -l /home/ | grep '^d' | awk '{system("chown root:" $4 " /home/" $4 "/domains/*/logs; chmod 750 /home/" $4 "/domains/*/logs")}'
#!/bin/sh
chmod 750 /home/${username}/domains/${domain}/logs
chown 0:${username} /home/${username}/domains/${domain}/logs
#!/bin/sh
FILE=/etc/virtual/$domain/filter.conf
if [ -e "$FILE" ]; then
echo "high_score=15" >> $FILE
echo "high_score_block=yes" >> $FILE
echo "where=delete" >> $FILE
echo "action=rewrite&value=filter&user=$username" >> /usr/local/directadmin/data/task.queue
fi
exit 0;
Or can I better put them on top, before the FILE statement?#!/bin/sh
FILE=/etc/virtual/$domain/filter.conf
if [ -e "$FILE" ]; then
echo "high_score=15" >> $FILE
echo "high_score_block=yes" >> $FILE
echo "where=delete" >> $FILE
echo "action=rewrite&value=filter&user=$username" >> /usr/local/directadmin/data/task.queue
fi
chmod 750 /home/${username}/domains/${domain}/logs
chown 0:${username} /home/${username}/domains/${domain}/logs
exit 0;
Can I just put both lines between the "fi" and the "exit 0;"?
Like this?