On 22/10/2012 21:28, Gustavo Etchudez wrote:
i'm using policyd with Accounting module under server with PLesk and i'm
running this simple script every 12 hours, i'll modify this to check and
add/remove only new or deleted domains for a new version
#!/bin/bash
mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -e "SELECT name FROM
domains" > /home/scripts/list_doms.txt
mysql -uadmin -p`cat /etc/psa/.psa.shadow` policyd -e "DELETE FROM
policy_group_members WHERE PolicyGroupID='2'";
for a in `cat /home/scripts/list_doms.txt`; do
B="@"$a
mysql -uadmin -p`cat /etc/psa/.psa.shadow` policyd -e "INSERT INTO
policy_group_members VALUES (NULL,'2','$B', '0', NULL)"
done
Wow!!!
This script will save me so much time and more importantly save me a lot
of stress.
Thank you very much for sharing this script. I will try it out.
Once again thank you for sharing this script.
P.V.Anthony
_______________________________________________
Users mailing list
[email protected]
http://lists.policyd.org/mailman/listinfo/users_lists.policyd.org