From owner-freebsd-ipfw Mon Mar 26 13:31: 5 2001 Delivered-To: freebsd-ipfw@freebsd.org Received: from apollo.ocsny.com (apollo.ocsny.com [204.107.76.2]) by hub.freebsd.org (Postfix) with ESMTP id 5EEB137B71A for ; Mon, 26 Mar 2001 13:31:01 -0800 (PST) (envelope-from mikel@ocsinternet.com) Received: from ocsinternet.com (thoth.upan.org [204.107.76.16]) by apollo.ocsny.com (8.9.2/8.9.3) with ESMTP id QAA90448; Mon, 26 Mar 2001 16:28:47 -0500 (EST) Message-ID: <3ABFB6CB.4A876CC2@ocsinternet.com> Date: Mon, 26 Mar 2001 16:38:19 -0500 From: Mikel X-Mailer: Mozilla 4.73 [en] (Win98; U) X-Accept-Language: en,it MIME-Version: 1.0 To: Johnny Dang Cc: FreeBSD IpFW Subject: Re: Scripting with IPFW References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-ipfw@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hey man cool, hope you don't mind I had to try your script out and well I came up with this...thanks for sending back the code byte... #!/bin/sh oif=`ifconfig fxp0 |grep inet | head -1 | awk '{print $2}'` omask=`ifconfig fxp0 |grep inet | head -1 | awk '{print $4}'` iif=`ifconfig rl0 |grep inet | head -1 | awk '{print $2}'` imask=`ifconfig rl0 |grep inet | head -1 | awk '{print $4}'` onet=`cidr -q ${oif} -h ${omask} | grep network | awk '{print $3}'` inet=`cidr -q ${iif} -h ${imask} | grep network | awk '{print $3}'` echo "onet=\"${onet}\"" echo "oif=\"${oif}\"" echo "omask=\"${omask}\"" echo echo "inet=\"${inet}\"" echo "iif=\"${iif}\"" echo "imask=\"${imask}\"" Cheers, Mikel PS: cidr is a neat little util found in /usr/ports/net/cidr Johnny Dang wrote: > Thanks you all (especially UNIX, SCANNER, Mikel, and Scott)... That is why > this FreeBSD is great... This line will do it (I can now base on this and > change to fix my need)... > > ifconfig de0 | grep "inet" | head -1 | awk '{print $2}' > > Thanks to you all... But why the orginal commands from Linux won't work on > FreeBSD? > > ifconfig de0 | grep "inet" | cut -d -f2 | cut -d " " -f1 ? > > Just for curiosity? Btw, I download the new RedHAT Wolverines and Mandrake > 8.0 and those GUI look like Lindows now. But my boss likes it !!!!! > > ++++++++++++++++++++++++++++++++++++++++++++++++++ > "The instructions said to use Windows 98 or better, > so I installed FreeBSD...It is working now!..." > ++++++++++++++++++++++++++++++++++++++++++++++++++ > Johnny Dang > Senior Network Engineer/MCSE + Internet > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-ipfw" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ipfw" in the body of the message