package guesthook import ( "context" "fmt" "os" "path/filepath" "strconv" "gitea.dooplex.hu/admin/felhom-agent/internal/proxmox" ) // Install/registration of the pre-start hook. The wrapper lives in a PVE `snippets`-enabled storage dir // (the `local` storage maps to /var/lib/vz/snippets) and is referenced per-guest by its volid. const ( // SnippetDir is the local-storage snippets directory PVE serves hookscripts from. SnippetDir = "/var/lib/vz/snippets" // SnippetName is the wrapper filename. SnippetName = "felhom-guest-hook.sh" // HookVolID is the volid form `pct set --hookscript` expects. HookVolID = "local:snippets/" + SnippetName // AgentBin is the installed agent binary the wrapper delegates to. AgentBin = "/usr/local/bin/felhom-agent" ) // SnippetPath is the absolute path of the installed wrapper. var SnippetPath = filepath.Join(SnippetDir, SnippetName) // snippetBody is the tiny wrapper PVE execs as `