You can get the list of your containers with "pct list", the first column is the ID. In the web interface it's also the number that is displayed next to the name in the overview.
You can get the list of your containers with "pct list", the first column is the ID. In the web interface it's also the number that is displayed next to the name in the overview.
Ah, my bad, misunderstood you there. Yes, it's the third argument of the hook call, so $3 is the correct approach.
First argument is the phase (job-start, job-end or job-abort), second the mode (stop, suspend or snapshot), and third one the vmid. Please also notice the usage of environment variables in the example script.