Update alpine-install.func
This commit is contained in:
parent
4ac80452ad
commit
b099350468
@ -99,13 +99,12 @@ setting_up_container() {
|
||||
msg_info "Setting up Container OS"
|
||||
|
||||
# Apply udhcpc.conf DNS override patch if Alpine
|
||||
if grep -qi 'alpine' /etc/os-release; then
|
||||
CONFIG_FILE="/etc/udhcpc/udhcpc.conf"
|
||||
|
||||
# Remove all active RESOLV_CONF= lines to avoid duplicates
|
||||
sed -i '/^RESOLV_CONF=/d' "$CONFIG_FILE"
|
||||
# Remove all RESOLV_CONF= lines (active or commented)
|
||||
sed -i '/^#*RESOLV_CONF="/d' "$CONFIG_FILE"
|
||||
|
||||
# Rebuild file with clean insertion after comment header
|
||||
# Rebuild file with single correct entry after header
|
||||
awk '
|
||||
/^# Do not overwrite \/etc\/resolv\.conf/ {
|
||||
print
|
||||
@ -113,10 +112,7 @@ setting_up_container() {
|
||||
next
|
||||
}
|
||||
{ print }
|
||||
' "$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
|
||||
' "$CONFIG_FILE" >"${CONFIG_FILE}.tmp" && mv "${CONFIG_FILE}.tmp" "$CONFIG_FILE"
|
||||
|
||||
while [ $i -gt 0 ]; do
|
||||
if [ "$(ip addr show | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -d'/' -f1)" != "" ]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user