mirror of
https://github.com/community-scripts/ProxmoxVED.git
synced 2026-02-25 05:57:26 +00:00
test alpine dns
This commit is contained in:
@@ -98,27 +98,6 @@ msg_error() {
|
||||
# This function sets up the Container OS by generating the locale, setting the timezone, and checking the network connection
|
||||
setting_up_container() {
|
||||
msg_info "Setting up Container OS"
|
||||
|
||||
# Check if a non-default DNS is configured in /etc/resolv.conf
|
||||
DNS=$(grep '^nameserver' /etc/resolv.conf | awk '{print $2}' | head -n1)
|
||||
CONFIG_FILE="/etc/udhcpc/udhcpc.conf"
|
||||
|
||||
# Patch only if DNS is set and not 127.0.0.1
|
||||
if [ -n "$DNS" ] && [ "$DNS" != "127.0.0.1" ]; then
|
||||
# Remove all RESOLV_CONF= lines (active or commented)
|
||||
sed -i '/^#*RESOLV_CONF="/d' "$CONFIG_FILE"
|
||||
|
||||
# Rebuild file with single correct entry after header
|
||||
awk '
|
||||
/^# Do not overwrite \/etc\/resolv\.conf/ {
|
||||
print
|
||||
print "RESOLV_CONF=\"no\""
|
||||
next
|
||||
}
|
||||
{ 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
|
||||
break
|
||||
|
||||
@@ -652,6 +652,7 @@ advanced_settings() {
|
||||
else
|
||||
UDHCPC_FIX="no"
|
||||
fi
|
||||
export UDHCPC_FIX
|
||||
|
||||
if MAC1=$(whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --inputbox "Set a MAC Address(leave blank for generated MAC)" 8 58 --title "MAC ADDRESS" 3>&1 1>&2 2>&3); then
|
||||
if [ -z "$MAC1" ]; then
|
||||
|
||||
Reference in New Issue
Block a user