From 52d3aaaf0ff54bed33e13a72b8a4a8c5ca2c749d Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Mon, 5 May 2025 16:09:48 +0200 Subject: [PATCH 1/3] Set DNS Options for Alpine --- misc/alpine-install.func | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/misc/alpine-install.func b/misc/alpine-install.func index d3eeaed..29e4e8a 100644 --- a/misc/alpine-install.func +++ b/misc/alpine-install.func @@ -194,4 +194,16 @@ customize() { fi echo "bash -c \"\$(curl -fsSL https://github.com/community-scripts/ProxmoxVED/raw/main/ct/${app}.sh)\"" >/usr/bin/update chmod +x /usr/bin/update + + NS_VALUE=$(echo "$PCT_OPTIONS" | grep -oP '(?<=-nameserver=)[^\s]+') + + if [ "$NS_VALUE" != "" ] && [ "$NS_VALUE" != "Host" ]; then + + CONFIG_FILE="/etc/udhcpc/udhcpc.conf" + if grep -q '^RESOLV_CONF=' "$CONFIG_FILE"; then + sed -i 's/^RESOLV_CONF=.*/RESOLV_CONF=no/' "$CONFIG_FILE" + else + echo 'RESOLV_CONF=no' >>"$CONFIG_FILE" + fi + fi } From 019fbeed9075d4cbb470f5c3dbd88a4e7db2af5c Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Mon, 5 May 2025 16:14:07 +0200 Subject: [PATCH 2/3] Set DNS Options for Alpine --- misc/alpine-install.func | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/alpine-install.func b/misc/alpine-install.func index 29e4e8a..885e7f3 100644 --- a/misc/alpine-install.func +++ b/misc/alpine-install.func @@ -195,7 +195,7 @@ customize() { echo "bash -c \"\$(curl -fsSL https://github.com/community-scripts/ProxmoxVED/raw/main/ct/${app}.sh)\"" >/usr/bin/update chmod +x /usr/bin/update - NS_VALUE=$(echo "$PCT_OPTIONS" | grep -oP '(?<=-nameserver=)[^\s]+') + NS_VALUE=$(echo "$PCT_OPTIONS" | sed -n 's/.*-nameserver=\([^ ]*\).*/\1/p') if [ "$NS_VALUE" != "" ] && [ "$NS_VALUE" != "Host" ]; then From 75ee44a4014ba4c2ca1edd27f3e1dec2acb8f1aa Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Mon, 5 May 2025 16:20:42 +0200 Subject: [PATCH 3/3] Set DNS Options for Alpine --- misc/alpine-install.func | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/alpine-install.func b/misc/alpine-install.func index 885e7f3..3be72d0 100644 --- a/misc/alpine-install.func +++ b/misc/alpine-install.func @@ -200,10 +200,10 @@ customize() { if [ "$NS_VALUE" != "" ] && [ "$NS_VALUE" != "Host" ]; then CONFIG_FILE="/etc/udhcpc/udhcpc.conf" - if grep -q '^RESOLV_CONF=' "$CONFIG_FILE"; then - sed -i 's/^RESOLV_CONF=.*/RESOLV_CONF=no/' "$CONFIG_FILE" + if grep -q '^#RESOLV_CONF=' "$CONFIG_FILE"; then + sed -i 's/^#RESOLV_CONF=.*/RESOLV_CONF="no"/' "$CONFIG_FILE" else - echo 'RESOLV_CONF=no' >>"$CONFIG_FILE" + echo 'RESOLV_CONF="no"' >>"$CONFIG_FILE" fi fi }