blob: c3358ea1c95ea0dce17606609355f8bdbca3ea89 [file] [log] [blame]
#! /bin/sh
# Return the interface with the default route.
# If there are 2 or more, only the first is returned.
# If there is none, nothing is returned.
(ip route show; ip -6 route show) | grep default | cut -f 5 -d ' ' | sort -u | head -n 1