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 2012/10/21 P.V.Anthony <[email protected]> > On 21/10/2012 01:21, Simon Hobson wrote: > > Not directly, but as the data is stored in MySQL then it should be >> fairly easy to write a script to handle it for you. Possibly you could >> add a hook into the virtual domains management software to do this >> whenever a domain is added. Or you could simply run an update script via >> cron to add/remove domains as needed. >> > > Thank you for the advice. I will try it out. > > By any chance, if there are others who has done this before, it would be > great to have the script. > > P.V.Anthony > > > > ______________________________**_________________ > Users mailing list > [email protected] > http://lists.policyd.org/**mailman/listinfo/users_lists.**policyd.org<http://lists.policyd.org/mailman/listinfo/users_lists.policyd.org> > -- Gustavo Etchudez mailto:[email protected]
_______________________________________________ Users mailing list [email protected] http://lists.policyd.org/mailman/listinfo/users_lists.policyd.org
