Update create_lxc.sh
This commit is contained in:
parent
0dd4b2d504
commit
e068565062
@ -280,14 +280,15 @@ if ! pct create "$CTID" "${TEMPLATE_STORAGE}:vztmpl/${TEMPLATE}" "${PCT_OPTIONS[
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$UDHCPC_FIX" == "yes" ]; then
|
if [ "$UDHCPC_FIX" == "yes" ]; then
|
||||||
CT_ROOT="/var/lib/lxc/${CTID}/rootfs"
|
# Ensure container is mounted
|
||||||
CONFIG_FILE="$CT_ROOT/etc/udhcpc/udhcpc.conf"
|
if ! mount | grep -q "/var/lib/lxc/${CTID}/rootfs"; then
|
||||||
|
pct mount "$CTID" >/dev/null 2>&1
|
||||||
# wait max. 5 seconds for rootfs
|
|
||||||
for i in {1..10}; do
|
|
||||||
if [ -f "$CONFIG_FILE" ]; then
|
|
||||||
break
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
CONFIG_FILE="/var/lib/lxc/${CTID}/rootfs/etc/udhcpc/udhcpc.conf"
|
||||||
|
|
||||||
|
for i in {1..10}; do
|
||||||
|
[ -f "$CONFIG_FILE" ] && break
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -307,4 +308,5 @@ if [ "$UDHCPC_FIX" == "yes" ]; then
|
|||||||
msg_error "udhcpc.conf not found in $CONFIG_FILE after waiting"
|
msg_error "udhcpc.conf not found in $CONFIG_FILE after waiting"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg_ok "LXC Container ${BL}$CTID${CL} ${GN}was successfully created."
|
msg_ok "LXC Container ${BL}$CTID${CL} ${GN}was successfully created."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user