diff options
author | brooks <brooks@FreeBSD.org> | 2005-08-26 01:07:51 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2005-08-26 01:07:51 +0000 |
commit | 8f09bbbbfb3963b60ad0c62488babc6e774bc9e3 (patch) | |
tree | b2b61b15405b41754d9988c770a69e97d117cd59 /sbin/dhclient | |
parent | c56a18dd497808037797a0f2d718afeee95c3871 (diff) | |
download | FreeBSD-src-8f09bbbbfb3963b60ad0c62488babc6e774bc9e3.zip FreeBSD-src-8f09bbbbfb3963b60ad0c62488babc6e774bc9e3.tar.gz |
Use a more robust, grep-free command to get the interface of the current
default route.
Submitted by: Rostislav Krasny <rosti dot bsd at gmail dot com>
Diffstat (limited to 'sbin/dhclient')
-rw-r--r-- | sbin/dhclient/dhclient-script | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sbin/dhclient/dhclient-script b/sbin/dhclient/dhclient-script index 4d7601e..408fc05 100644 --- a/sbin/dhclient/dhclient-script +++ b/sbin/dhclient/dhclient-script @@ -20,7 +20,6 @@ # NETSTAT=/usr/bin/netstat -GREP=/usr/bin/grep AWK=/usr/bin/awk HOSTNAME=/bin/hostname @@ -198,7 +197,7 @@ if [ -f /etc/dhclient-enter-hooks ]; then fi if [ -x $NETSTAT ]; then - if_defaultroute=`$NETSTAT -rn | $GREP "^default" | $AWK '{print $6}'` + if_defaultroute=`$NETSTAT -rnf inet | $AWK '{if ($1=="default") printf $6}'` else if_defaultroute="x" fi |