Date: Sat, 2 Mar 2002 21:32:42 -0800 From: "Crist J. Clark" <cjc@FreeBSD.ORG> To: "Scott M. Nolde" <scott@smnolde.com> Cc: George.Giles@mcmail.vanderbilt.edu, freebsd-security@FreeBSD.ORG Subject: Re: ipfw and DHCP Message-ID: <20020302213242.Q66092@blossom.cjclark.org> In-Reply-To: <20020302224033.D32060@smnolde.com>; from scott@smnolde.com on Sat, Mar 02, 2002 at 10:40:33PM -0500 References: <OF25945D77.FFDCD63C-ON86256B6F.004C1698@MC.VANDERBILT.EDU> <20020302224033.D32060@smnolde.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Mar 02, 2002 at 10:40:33PM -0500, Scott M. Nolde wrote: > George.Giles@mcmail.vanderbilt.edu(George.Giles@mcmail.vanderbilt.edu)@2002.03.01 07:52:26 +0000: > > How do you get ipfw to pick-up DHCP value for oif in the rc.firewall script > > ? > > Ahhhhhhhhh!!! Are you all _trying_ to hurt me? > This is what I do: > onet=`/sbin/ifconfig dc0 | grep -w inet | awk '{print $2}' | awk -F. \ > '{print $1 "." $2 "." $3 ".0"}'` onet=`/sbin/ifconfig dc0 | awk '/inet / { split($2, ip, /\./); print ip[1]"."ip[2]"."ip[3]".0"; exit }'` > omask=`grep subnet-mask /var/db/dhclient.leases | tail -1 | sed \ > "s/[,;]//g" | awk '{print $3}'` omask=`awk '/subnet-mask/ { sub(/;/, "", $3); sm = $3; } END { print sm; }' /var/db/dhclient.leases` Piping grep(1) into awk(1)... *shiver* It just looks so icky. And piping grep(1) into awk(1) and then into another awk(1) well, I just... just... *faint* *thunk* -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020302213242.Q66092>