From 441a69c85dcd9a00f702410d33e2058f41c4cf4e Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 4 Aug 2025 12:32:56 +0200 Subject: [PATCH] Update build.func --- misc/build.func | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/misc/build.func b/misc/build.func index 751bb915..6c7781f6 100644 --- a/misc/build.func +++ b/misc/build.func @@ -1428,14 +1428,17 @@ EOF' fi msg_ok "Customized LXC Container" - if ! lxc-attach -n "$CTID" -- bash -s < <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/install/$var_install.sh); then - EXITCODE=$? - echo "DEBUG: lxc-attach exit code was $EXITCODE" - if [[ $EXITCODE -eq 10 ]]; then - destroy_lxc - fi - exit $EXITCODE + lxc-attach -n "$CTID" -- bash -c ' + bash -s < /dev/stdin + echo __EXITCODE__$? +' < <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/install/$var_install.sh) | tee /tmp/app_install.log + + EXITCODE=$(awk -F__EXITCODE__ '/__EXITCODE__/{print $2}' /tmp/app_install.log | tail -n1) + echo "DEBUG: Parsed container exit code: $EXITCODE" + if [[ "$EXITCODE" == "10" ]]; then + destroy_lxc fi + exit "$EXITCODE" } destroy_lxc() {