Update create_lxc.sh
This commit is contained in:
parent
39414667b8
commit
0dd4b2d504
@ -283,6 +283,14 @@ if [ "$UDHCPC_FIX" == "yes" ]; then
|
|||||||
CT_ROOT="/var/lib/lxc/${CTID}/rootfs"
|
CT_ROOT="/var/lib/lxc/${CTID}/rootfs"
|
||||||
CONFIG_FILE="$CT_ROOT/etc/udhcpc/udhcpc.conf"
|
CONFIG_FILE="$CT_ROOT/etc/udhcpc/udhcpc.conf"
|
||||||
|
|
||||||
|
# wait max. 5 seconds for rootfs
|
||||||
|
for i in {1..10}; do
|
||||||
|
if [ -f "$CONFIG_FILE" ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 0.5
|
||||||
|
done
|
||||||
|
|
||||||
if [ -f "$CONFIG_FILE" ]; then
|
if [ -f "$CONFIG_FILE" ]; then
|
||||||
msg_info "Patching udhcpc.conf for Alpine DNS override"
|
msg_info "Patching udhcpc.conf for Alpine DNS override"
|
||||||
sed -i '/^#*RESOLV_CONF="/d' "$CONFIG_FILE"
|
sed -i '/^#*RESOLV_CONF="/d' "$CONFIG_FILE"
|
||||||
@ -296,7 +304,7 @@ if [ "$UDHCPC_FIX" == "yes" ]; then
|
|||||||
' "$CONFIG_FILE" >"${CONFIG_FILE}.tmp" && mv "${CONFIG_FILE}.tmp" "$CONFIG_FILE"
|
' "$CONFIG_FILE" >"${CONFIG_FILE}.tmp" && mv "${CONFIG_FILE}.tmp" "$CONFIG_FILE"
|
||||||
msg_ok "Patched udhcpc.conf (RESOLV_CONF=\"no\")"
|
msg_ok "Patched udhcpc.conf (RESOLV_CONF=\"no\")"
|
||||||
else
|
else
|
||||||
msg_error "udhcpc.conf not found in $CONFIG_FILE"
|
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