Skip to content

Commit

Permalink
keep copy of org resolv.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
angelnu committed Sep 11, 2022
1 parent b45beeb commit 7977174
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/gateway_sidecar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ cat /default_config/settings.sh
cat /config/settings.sh
. /config/settings.sh

# Make a copy of the original resolv.conf (so we can get the K8S DNS in case of a container reboot)
if [ ! -f /etc/resolv.conf.org ]; then
cp /etc/resolv.conf /etc/resolv.conf.org
echo "/etc/resolv.conf.org written"
fi

#Get K8S DNS
K8S_DNS=$(grep nameserver /etc/resolv.conf | cut -d' ' -f2)
K8S_DNS=$(grep nameserver /etc/resolv.conf.org | cut -d' ' -f2)


cat << EOF > /etc/dnsmasq.d/pod-gateway.conf
Expand Down

0 comments on commit 7977174

Please sign in to comment.