Posted By: jevingala on July 26, 2019, 3:03 pm | Post: 1 |
Hi,
You can try using hooks to write custom config in vps config file : https://www.virtualizor.com/docs/developers/hooks/#after_config_write ----------------------- Regards, Virtualizor Team. http://virtualizor.com/ |
Posted By: m9shyamalan on July 29, 2019, 6:44 am | Post: 2 |
Quote From : jevingala July 26, 2019, 3:03 pm Hi,
You can try using hooks to write custom config in vps config file : https://www.virtualizor.com/docs/developers/hooks/#after_config_write Exactly what I was looking for! Thanks, I will give it a shot and report back. |
Posted By: m9shyamalan on August 2, 2019, 1:39 am | Post: 3 |
Quote From : jevingala July 26, 2019, 3:03 pm Hi,
You can try using hooks to write custom config in vps config file : https://www.virtualizor.com/docs/developers/hooks/#after_config_write Hi Jev, Do you know if these hooks output logs anywhere? I Couldn't find any information in the documentation, and I'm trying to troubleshoot an error. I am seeing "There was an error in editing the VPS" when the after_config_write.php hook is in place. The VM is being edited as per the changes on the GUI, but the hook is not running. I am able to manually run the function from the command line, which is running as expected, so I am hoping to find the output Virtualizor is seeing to track down the problem. Thanks |
Posted By: chirag on August 2, 2019, 9:04 am | Post: 4 |
Hi,
Sir can you send us the hook file ? So that we can check on our server ? ----------------------- Virtualizor - VPS Control Panel Follow us on Facebook |
Posted By: m9shyamalan on August 14, 2019, 6:45 am | Post: 5 |
Hey Guys,
This issue is now resolved, just wanted to post back so if anyone else has this issue. I read the document linked by jevingala: https://www.virtualizor.com/docs/developers/hooks/#after_config_write and built off the example function, but was getting an error message every time I edited a VM. My mistake was not correctly adding the PHP codes at the start and end of the document, and following the documentation blindly. FYI my complete script looks like this: PHP Code
Hope this helps anyone else having issues |
Posted By: chirag on August 14, 2019, 7:19 am | Post: 6 |
Hi,
Sir glad to know that your issue is resolved. Let us know for further information. We will be happy to help you. ----------------------- Virtualizor - VPS Control Panel Follow us on Facebook |