I set up WHMCS on my own VPS. I also create a bash script that can create a new server on my could provider and install the OpenVPN server on that.
You have to create some PHP script or (whmcs addon module) and connect it to my whmcs. it reads the username from the client area and location from the product list and sends those to my bash script.
my bash script downloads the OpenVPN profile, you have to put it somewhere in the client area then the customer can download it and other users don't allow to download it. I also have two other bash scripts that stop the server and delete it for suspending and Terminating the servers.
My bash script got 2 variable:
1- the username
2- the location
I can use this script like: /home/username/[login to view URL] USERNAME1 de-fra1
I can edit my bash script but I don't know PHP.
please read my scenario:
in WHMCS you can create a product/service so I want to create some product/service that shows it belongs to some Location to my cloud providers.
for example I create 2 Products.
the first Product: Dedicated VPN in Germany
and the Second one: Dedicated VPN in USA
my script work like this:
./[login to view URL] $username $location
the $username can be set anything
but the location should: de-fra1 for Germany-frankfurt
and us-chi1for USA-Chicago
when a customer chooses Germany your PHP code must pass the de-fra1 as a second parameter to my bash script and then hen runs the bash script. my bash script will create a server in my cloud provider and install OpenVPN on it then create a vpn profile in some directory. my costumers should have to download this profile to use their VPN server.
I also need another code to stop the server and another one to terminate it.
I have 3 bash script:
1- for create the server that got 2 variable: $username $location
2- stop the server that got 1 variable: $username
3- terminate the server that got 1 variable: $username
if customer doesn't pay for Extended time I want to run the stop script and after a while run the terminate script
Type your favorite Drink in Proposal to avoid spams.