Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7825f6be80 | ||
|
|
1e0a1308bf |
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
All notable changes to the VirtFusion Direct Provisioning Module for WHMCS.
|
All notable changes to the VirtFusion Direct Provisioning Module for WHMCS.
|
||||||
|
|
||||||
|
## [1.4.4] - 2026-04-25
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
- **`install.sh`: "TMP: unbound variable" error at script exit, plus exit code 1 even on successful installs.** The cleanup `trap 'rm -rf "$TMP"' EXIT` referenced a `local TMP` from inside `cmd_sync()`. The EXIT trap doesn't fire until the *shell* exits — by which time the function-scoped local is out of scope — and `set -u` then exploded the trap body, masking the real exit code with `1`. Fix: drop `local` so `TMP` persists at script scope until cleanup runs, and switch the trap body to `${TMP:-}` so any future regression that tightens TMP's scope still survives the trap. Cosmetic in practice (the install/upgrade work itself completed before the trap ran), but the non-zero exit broke automated wrappers and cron-driven invocations that check `$?`.
|
||||||
|
|
||||||
## [1.4.3] - 2026-04-25
|
## [1.4.3] - 2026-04-25
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|||||||
10
install.sh
10
install.sh
@@ -135,9 +135,15 @@ cmd_sync() {
|
|||||||
[ -n "$OWNER" ] || { err "Could not detect parent directory owner via stat"; exit 1; }
|
[ -n "$OWNER" ] || { err "Could not detect parent directory owner via stat"; exit 1; }
|
||||||
info "Owner (from $WHMCS/modules/servers): $OWNER"
|
info "Owner (from $WHMCS/modules/servers): $OWNER"
|
||||||
|
|
||||||
local TMP
|
# NOTE: TMP is intentionally NOT declared `local`. The EXIT trap fires when
|
||||||
|
# the shell exits, not when this function returns — by then a function-local
|
||||||
|
# would be out of scope and `set -u` would explode the trap body with
|
||||||
|
# "TMP: unbound variable", masking the script's real exit code with 1.
|
||||||
|
# The `${TMP:-}` expansion in the trap is belt-and-suspenders: harmless
|
||||||
|
# if TMP somehow ends up unset, and prevents future regressions if anyone
|
||||||
|
# moves the assignment back into a tighter scope.
|
||||||
TMP=$(mktemp -d)
|
TMP=$(mktemp -d)
|
||||||
trap 'rm -rf "$TMP"' EXIT
|
trap 'rm -rf "${TMP:-}"' EXIT
|
||||||
|
|
||||||
info "Downloading $VERSION..."
|
info "Downloading $VERSION..."
|
||||||
curl -fsSL "https://github.com/$REPO/archive/refs/tags/$VERSION.tar.gz" -o "$TMP/src.tar.gz"
|
curl -fsSL "https://github.com/$REPO/archive/refs/tags/$VERSION.tar.gz" -o "$TMP/src.tar.gz"
|
||||||
|
|||||||
Reference in New Issue
Block a user