summaryrefslogtreecommitdiffstats
path: root/sbin/dhclient
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2005-08-26 01:07:51 +0000
committerbrooks <brooks@FreeBSD.org>2005-08-26 01:07:51 +0000
commit8f09bbbbfb3963b60ad0c62488babc6e774bc9e3 (patch)
treeb2b61b15405b41754d9988c770a69e97d117cd59 /sbin/dhclient
parentc56a18dd497808037797a0f2d718afeee95c3871 (diff)
downloadFreeBSD-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-script3
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
OpenPOWER on IntegriCloud