diff --git a/ct/create_lxc.sh b/ct/create_lxc.sh index d223038..a056800 100644 --- a/ct/create_lxc.sh +++ b/ct/create_lxc.sh @@ -283,6 +283,9 @@ if [ "$UDHCPC_FIX" == "yes" ]; then # Ensure container is mounted if ! mount | grep -q "/var/lib/lxc/${CTID}/rootfs"; then pct mount "$CTID" >/dev/null 2>&1 + MOUNTED_HERE=true + else + MOUNTED_HERE=false fi CONFIG_FILE="/var/lib/lxc/${CTID}/rootfs/etc/udhcpc/udhcpc.conf" @@ -307,6 +310,11 @@ if [ "$UDHCPC_FIX" == "yes" ]; then else msg_error "udhcpc.conf not found in $CONFIG_FILE after waiting" fi + + # Clean up: only unmount if we mounted it here + if [ "${MOUNTED_HERE}" = true ]; then + pct unmount "$CTID" >/dev/null 2>&1 + fi fi msg_ok "LXC Container ${BL}$CTID${CL} ${GN}was successfully created." diff --git a/misc/alpine-install.func b/misc/alpine-install.func index 7d9194a..8fae6a2 100644 --- a/misc/alpine-install.func +++ b/misc/alpine-install.func @@ -95,6 +95,14 @@ msg_error() { echo -e "${BFR}${CROSS}${RD}${msg}${CL}" } +stop_spinner() { + if [ -n "${SPINNER_PID:-}" ]; then + kill "$SPINNER_PID" >/dev/null 2>&1 + wait "$SPINNER_PID" 2>/dev/null + unset SPINNER_PID + fi +} + # This function sets up the Container OS by generating the locale, setting the timezone, and checking the network connection setting_up_container() { msg_info "Setting up Container OS"