Update alpine-install.func
This commit is contained in:
parent
b099350468
commit
c74738bfcf
@ -101,6 +101,11 @@ setting_up_container() {
|
||||
# Apply udhcpc.conf DNS override patch if Alpine
|
||||
CONFIG_FILE="/etc/udhcpc/udhcpc.conf"
|
||||
|
||||
# Extract any configured DNS server from /etc/network/interfaces
|
||||
DNS_LINE=$(grep -E '^ *dns-nameservers' /etc/network/interfaces 2>/dev/null | awk '{print $2}')
|
||||
|
||||
# Only patch if DNS is set and not 'host'
|
||||
if [ -n "$DNS_LINE" ] && [ "$DNS_LINE" != "host" ]; then
|
||||
# Remove all RESOLV_CONF= lines (active or commented)
|
||||
sed -i '/^#*RESOLV_CONF="/d' "$CONFIG_FILE"
|
||||
|
||||
@ -113,6 +118,7 @@ setting_up_container() {
|
||||
}
|
||||
{ print }
|
||||
' "$CONFIG_FILE" >"${CONFIG_FILE}.tmp" && mv "${CONFIG_FILE}.tmp" "$CONFIG_FILE"
|
||||
fi
|
||||
|
||||
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