Update alpine-install.func

This commit is contained in:
CanbiZ 2025-05-07 08:04:33 +02:00
parent c0c2f6544e
commit 1361f2b59f

View File

@ -100,11 +100,19 @@ setting_up_container() {
if [ "$UDHCPC_FIX" == "yes" ]; then if [ "$UDHCPC_FIX" == "yes" ]; then
CONFIG_FILE="/etc/udhcpc/udhcpc.conf" CONFIG_FILE="/etc/udhcpc/udhcpc.conf"
echo -e "${INFO}${YW}[DEBUG] UDHCPC_FIX is set. Patching $CONFIG_FILE${CL}"
if grep -q '^#RESOLV_CONF=' "$CONFIG_FILE"; then if grep -q '^#RESOLV_CONF=' "$CONFIG_FILE"; then
sed -i 's/^#RESOLV_CONF=.*/RESOLV_CONF="no"/' "$CONFIG_FILE" sed -i 's/^#RESOLV_CONF=.*/RESOLV_CONF="no"/' "$CONFIG_FILE"
echo -e "${INFO}${YW}[DEBUG] Uncommented existing RESOLV_CONF line${CL}"
elif ! grep -q '^RESOLV_CONF=' "$CONFIG_FILE"; then elif ! grep -q '^RESOLV_CONF=' "$CONFIG_FILE"; then
echo 'RESOLV_CONF="no"' >>"$CONFIG_FILE" echo 'RESOLV_CONF="no"' >>"$CONFIG_FILE"
echo -e "${INFO}${YW}[DEBUG] Added new RESOLV_CONF line${CL}"
else
echo -e "${INFO}${YW}[DEBUG] RESOLV_CONF already set. No action taken.${CL}"
fi fi
else
echo -e "${INFO}${YW}[DEBUG] UDHCPC_FIX not required. Skipping patch.${CL}"
fi fi
while [ $i -gt 0 ]; do while [ $i -gt 0 ]; do