Skip to content

Commit

Permalink
Be more accuracy for getting def_route_int and def_route_ip
Browse files Browse the repository at this point in the history
  • Loading branch information
bysnupy committed Aug 8, 2018
1 parent 4e86c4f commit abc8eb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions roles/openshift_node/files/networkmanager/99-origin-dns.sh
Expand Up @@ -44,8 +44,8 @@ if [[ $2 =~ ^(up|dhcp4-change|dhcp6-change)$ ]]; then
# couldn't find an existing method to determine if the interface owns the
# default route
def_route=$(/sbin/ip route list match 0.0.0.0/0 | awk '{print $3 }')
def_route_int=$(/sbin/ip route get to ${def_route} | awk '{print $3}')
def_route_ip=$(/sbin/ip route get to ${def_route} | awk '{print $5}')
def_route_int=$(/sbin/ip route get to ${def_route} | awk -F 'dev' '{print $2}' | head -n1 | awk '{print $1}')
def_route_ip=$(/sbin/ip route get to ${def_route} | awk -F 'src' '{print $2}' | head -n1 | awk '{print $1}')
if [[ ${DEVICE_IFACE} == ${def_route_int} ]]; then
if [ ! -f /etc/dnsmasq.d/origin-dns.conf ]; then
cat << EOF > /etc/dnsmasq.d/origin-dns.conf
Expand Down

0 comments on commit abc8eb7

Please sign in to comment.