Set DNS Options for Alpine
This commit is contained in:
parent
a611704670
commit
52d3aaaf0f
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user