Update alpine-install.func

This commit is contained in:
CanbiZ 2025-05-07 09:13:35 +02:00
parent 4ac80452ad
commit b099350468

View File

@ -99,13 +99,12 @@ setting_up_container() {
msg_info "Setting up Container OS" msg_info "Setting up Container OS"
# Apply udhcpc.conf DNS override patch if Alpine # Apply udhcpc.conf DNS override patch if Alpine
if grep -qi 'alpine' /etc/os-release; then
CONFIG_FILE="/etc/udhcpc/udhcpc.conf" CONFIG_FILE="/etc/udhcpc/udhcpc.conf"
# Remove all active RESOLV_CONF= lines to avoid duplicates # Remove all RESOLV_CONF= lines (active or commented)
sed -i '/^RESOLV_CONF=/d' "$CONFIG_FILE" sed -i '/^#*RESOLV_CONF="/d' "$CONFIG_FILE"
# Rebuild file with clean insertion after comment header # Rebuild file with single correct entry after header
awk ' awk '
/^# Do not overwrite \/etc\/resolv\.conf/ { /^# Do not overwrite \/etc\/resolv\.conf/ {
print print
@ -115,9 +114,6 @@ setting_up_container() {
{ print } { print }
' "$CONFIG_FILE" >"${CONFIG_FILE}.tmp" && mv "${CONFIG_FILE}.tmp" "$CONFIG_FILE" ' "$CONFIG_FILE" >"${CONFIG_FILE}.tmp" && mv "${CONFIG_FILE}.tmp" "$CONFIG_FILE"
echo -e "${INFO}${YW}[DEBUG] Cleaned and set RESOLV_CONF=\"no\" in $CONFIG_FILE${CL}"
fi
while [ $i -gt 0 ]; do while [ $i -gt 0 ]; do
if [ "$(ip addr show | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -d'/' -f1)" != "" ]; then if [ "$(ip addr show | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -d'/' -f1)" != "" ]; then
break break