This commit is contained in:
CanbiZ
2025-05-07 13:10:00 +02:00
parent 2d9fc6158a
commit e2c9f279a3
2 changed files with 16 additions and 0 deletions

View File

@@ -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."