HelperScripts-for-ProxmoxVE/misc
CanbiZ (MickLesk) 896714e06f
core/vm's: ensure script state is sent on script exit (#11991)
* Ensure API update is sent on script exit

Add exit-time telemetry handling across scripts to avoid orphaned "installing" records. Introduce local exit_code capture in api_exit_script and cleanup handlers and, when POST_TO_API_DONE is true but POST_UPDATE_DONE is not, post a final status (marking failures on non-zero exit codes, or marking done/failed in VM cleanups based on exit code). Changes touch misc/build.func, misc/vm-core.func and various vm/*-vm.sh cleanup functions to reliably send post_update_to_api on normal or early exits.

* Update api.func

* fix(telemetry): add missing exit codes to explain_exit_code()

- Add curl error codes: 4, 5, 8, 23, 25, 30, 56, 78
- Add code 10: Docker/privileged mode required (used in ~15 scripts)
- Add code 75: Temporary failure (retry later)
- Add BSD sysexits.h codes: 64-77
- Sync error_handler.func fallback with canonical api.func
2026-02-16 17:14:00 +01:00
..
images remove old files and assets (#9991) 2025-12-15 17:37:26 +01:00
alpine-install.func fix: remove duplicate error handler from alpine-install.func (#11971) 2026-02-16 08:51:05 +01:00
alpine-tools.func tools.func: persist /usr/local/bin in shell PATHs (#11970) 2026-02-16 10:30:05 +01:00
api.func core/vm's: ensure script state is sent on script exit (#11991) 2026-02-16 17:14:00 +01:00
build.func core/vm's: ensure script state is sent on script exit (#11991) 2026-02-16 17:14:00 +01:00
cloud-init.func feat(cloud-init): add interactive SSH key discovery and selection (#11547) 2026-02-05 08:11:13 +01:00
core.func core: improve error reporting with structured error strings and better categorization + output formatting (#11907) 2026-02-14 15:28:30 +01:00
error_handler.func core/vm's: ensure script state is sent on script exit (#11991) 2026-02-16 17:14:00 +01:00
install.func fix: remove duplicate error handler from alpine-install.func (#11971) 2026-02-16 08:51:05 +01:00
tools.func tools.func: persist /usr/local/bin in shell PATHs (#11970) 2026-02-16 10:30:05 +01:00
vm-core.func core/vm's: ensure script state is sent on script exit (#11991) 2026-02-16 17:14:00 +01:00