[Firehol-support] Multiple Ip Allows - Denigh rest of subnet

Thomas Arendsen Hein thomas at intevation.de
Wed Dec 3 10:00:03 GMT 2003


On Mon, Dec 01, 2003 at 07:20:48AM +0200, Costa Tsaousis wrote:
> I don't think that BASH will accept this # as a comment.
> You can move this list to another file (say, /etc/firehol/ips.txt) and use
> this here:
> 
> accepted_ips="`cat /etc/firehol/ips.txt | grep -v '^#'`"
> 
> (copy and paste it, there are 3 kinds of quotes here)
> Then put this in /etc/firehol/ips.txt
> 
> 192.168.2.96
> 192.168.2.42
> # 192.168.2.54
> 192.168.2.66
> 192.168.2.174
> 
> Note that the # has to be the first character of line. If it is not, it
> will appear in your list. No other comments are allowed in this file.

This one doesn't require another file, isn't picky about spaces and
allows variables inside the list:

foo="this.host.example"
accepted_ips="`grep -v '^ *#' << EOF
192.168.2.96
192.168.2.42
# 192.168.2.54
$foo
192.168.2.66
192.168.2.174
EOF`"

Thomas

-- 
Email: thomas at intevation.de
http://intevation.de/~thomas/




More information about the Firehol-support mailing list