Hookscript Languages?

Stereoscope

Member
Jan 27, 2024
95
8
13
What languages are supported for hookscripts? Perl obviously is as per /usr/share/pve-docs/examples/guest-example-hookscript.pl

Can I use any other languages?
 
Yes, any executable works. As in the Perl based example, the hookscript will get a few parameters that you will need to handle. So it can be another scripting language like python or bash, or you might compile your own little program.
 
Here is a small neat bash hookscript created (& apparently working / tested) by the user leesteken, which demonstrates it simplicity.
Please note you have to make that script executable & store it in a suitable snippets storage & set it to the config of the LXC/VM.