From 6ae27cb6cea8dcd1a019f924e2eab723d68f3761 Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Fri, 26 Aug 2005 01:07:51 +0000 Subject: [PATCH] Use a more robust, grep-free command to get the interface of the current default route. Submitted by: Rostislav Krasny --- sbin/dhclient/dhclient-script | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sbin/dhclient/dhclient-script b/sbin/dhclient/dhclient-script index 4d7601e61a7d..408fc05f4fa9 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