Re: [Shorewall-users] Macro files bug

Andrew Suffield
Fri, 26 Oct 2007 22:16:20 -0000

On Fri, Oct 26, 2007 at 03:01:26PM -0700, Tom Eastep
wrote:
> > How about something so simple as:
> >
> > SHELL for z in x y z; do echo ACCEPT fw $z tcp ssh; done
> >
> > Line continuation can be used for more complex scripts.
> >
> > And it took me less that 1/2 hour to get that working :-) And
it''s available
> > in any file.
> >
>
> And just to show I''m not a language bigot:
>
> 	PERL for ( qw(fw dmz) ) { printf "ACCEPT net $_ tcp 25\n"; }

Hmm, assuming that it''s just evaled then you could probably stash a
sub in one of the extension scripts that runs early in the compile
process, and then:

PERL SMTP qw{fw net}

gives you the "smarter macro" feature.

(It does depend what package you''re evaling stuff in - ideally they
should all be tossed into a private namespace, so you don''t
accidentally redefine parts of shorewall-perl)

It is not immediately apparent how to get the same effect from the
shell version. Maybe something with scripts and the search path?