Add a method to hard override dns servers

This commit is contained in:
Kristian Haugene
2020-10-24 00:36:30 +02:00
parent 58611faff5
commit 14ec8d4fb8

View File

@@ -13,6 +13,15 @@ if [[ -x /scripts/openvpn-pre-start.sh ]]; then
echo "/scripts/openvpn-pre-start.sh returned $?"
fi
# Allow for overriding the DNS used directly in the /etc/resolv.conf
if compgen -e | grep -q "OVERRIDE_DNS"; then
echo "One or more OVERRIDE_DNS addresses found. Will use them to overwrite /etc/resolv.conf"
echo "" > /etc/resolv.conf
for var in $(compgen -e | grep "OVERRIDE_DNS"); do
echo "nameserver $(printenv $var)" >> /etc/resolv.conf
done
fi
# If create_tun_device is set, create /dev/net/tun
if [[ "${CREATE_TUN_DEVICE,,}" == "true" ]]; then
mkdir -p /dev/net