[Snort-users] Re: [Summary] New Snort Configuration (FreeBSD 4.1S)

Gregor Binder gbinder at ...462...
Wed Sep 20 18:57:56 EDT 2000

Robert E. Leever on Wed, Sep 20, 2000 at 09:52:01AM -0700:


> Only change I will make is to substitute
> a grep for the tail and head.

and since awk can do (a lot) more than cut, let's get rid of grep as

> MYIP=`ifconfig $IFO| grep broadcast| awk '{print $2}'`

MYIP=`ifconfig $IFO | awk '/inet/ { print $2; exit }'`

Matching 'inet' instead of 'broadcast' is more portable by the way,
verified to work on OpenBSD, Solaris, HP-UX and RedHat (you have to
add a 'gsub( /addr:/,"",$2 );' before the 'print' in the awk program
to make this work on RedHat).


  Gregor Binder.

Gregor Binder  <gbinder at ...462...>  http://www.sysfive.com/~gbinder/
sysfive.com GmbH             UNIX. Networking. Security. Applications.
Gaertnerstrasse 125b, 20253 Hamburg, Germany       TEL +49-40-63647482
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 234 bytes
Desc: not available
URL: <https://lists.snort.org/pipermail/snort-users/attachments/20000921/f05b21ce/attachment.sig>

More information about the Snort-users mailing list