Custom Script to run when reseller is upgraded?

unixguru

Verified User
Joined
Mar 6, 2010
Messages
71
Location
Four Marks, Alton, Hampshire
Hi,

I use cloudlinux and allow users to have unlimited domains, but have scripts which create a special conf-file in their area ...data/users/RESELLER/special.conf which contains amoungst others a variable MAX_USERS=xxx, so resellers cannot have unlimited sub-accounts.

This file is picked used by user_create_pre to ensure that the number of users has not been exceeded.

I would like to know, if a user is "upgraded" by the API (by hostbill or WHMCS), is there a script that I can customise to re-write the MAX_USERS variable stored in the conf file?

I've had a good look around and not been able to find anything.

Any help would be greatly appreciated.
 
Why would you need the directadmin api at all if nothing is happening on the directadmin side?
 
Last edited:
@chatwizrd, because Hostilbill uses the API to make say a bronze reseller a silver or old reseller. I'm looking for a script, which can be updated to update the MAX_USERS.

@ zEitEr To be honest I haven't tested whether an upgrade actually updated the MAX_USERS by re-running the post_create script again, I just assumed it wouldn't.

Some testing to be done!

Many thanks!
 
I've solved this by making user_create_pre more intelligent, not having to use the file, but calculating the number of users based on the diskspace allocated, except if special.conf exists (for exceptions).
 
Back
Top