my lame attempt at a shell script...

Eric F Crist ecrist at secure-computing.net
Thu Jan 6 16:17:26 PST 2005


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20050106/a8137849/PGP.bin


More information about the freebsd-questions mailing list