Update alpine-install.func
This commit is contained in:
parent
4ac80452ad
commit
b099350468
@ -99,24 +99,20 @@ 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
|
||||||
print "RESOLV_CONF=\"no\""
|
print "RESOLV_CONF=\"no\""
|
||||||
next
|
next
|
||||||
}
|
}
|
||||||
{ 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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user