From owner-freebsd-questions@FreeBSD.ORG Fri Jan 7 00:17:26 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BB34516A4DC for ; Fri, 7 Jan 2005 00:17:26 +0000 (GMT) Received: from grog.secure-computing.net (grog.secure-computing.net [63.228.14.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 046EA43D1F for ; Fri, 7 Jan 2005 00:17:26 +0000 (GMT) (envelope-from ecrist@secure-computing.net) Received: from [192.168.1.102] (c-66-41-157-209.mn.client2.attbi.com [66.41.157.209]) (authenticated bits=0)j070HNEh033430; Thu, 6 Jan 2005 18:17:24 -0600 (CST) (envelope-from ecrist@secure-computing.net) In-Reply-To: References: <06DDB71C-5DB4-11D9-B56F-000D9333E43C@secure-computing.net> <8B357427-5DB7-11D9-89A5-000D93AD26C8@tntluoma.com> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-1-48299076" Message-Id: <7B531D49-6041-11D9-8A15-000D9333E43C@secure-computing.net> Content-Transfer-Encoding: 7bit From: Eric F Crist Date: Thu, 6 Jan 2005 18:17:14 -0600 To: "Colin J. Raven" X-Pgp-Agent: GPGMail 1.0.2 X-Mailer: Apple Mail (2.619) X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.64 X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on grog.secure-computing.net cc: Timothy Luoma cc: FreeBSD-Questions Questions Subject: Re: my lame attempt at a shell script... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2005 00:17:26 -0000 --Apple-Mail-1-48299076 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Ok all. First off, thanks again for all the help you've offered thus far. That being said, I'm having a problem with variables in a function. The code I'm having a problem with is: setup_loopback () { ${fwcmd} add ${rulenum1} pass all from any to any via lo0; ${rulenum1}=`expr $rulenum1 + 50` ${fwcmd} add ${rulenum1} deny all from any to 127.0.0.0/8; ${rulenum1}=`expr $rulenum1 + 50` ${fwcmd} add ${rulenum1} deny ip from 127.0.0.0/8 to any; ${rulenum1}=`expr $rulenum1 + 50` } The output of this, when run, is: 00050 allow ip from any to any via lo0 50=100: not found 00050 deny ip from any to 127.0.0.0/8 50=100: not found 00050 deny ip from 127.0.0.0/8 to any 50=100: not found This tells me that it's doing the math correctly, but it's not reassigning the calculated value back to the variable. Any pointers? _______________________________________________________ Eric F Crist "I am so smart, S.M.R.T!" Secure Computing Networks -Homer J Simpson --Apple-Mail-1-48299076 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (Darwin) iEYEARECAAYFAkHd1QoACgkQRAAY9knOW+qn8QCfYkcjHUZfrTOpOXFOMUebtW8M HE4AnjGnCTdJxfrSEUGvkAALoGTPH0Fr =bduo -----END PGP SIGNATURE----- --Apple-Mail-1-48299076--