On Tue, Jan 17, 2017 at 01:00:57PM +0100, Jan Matejka wrote: > On 01/17/2017 11:03 AM, Tim Weippert wrote: > > Hi, > > > > i currently try to do different includes, based on an variable/define > > within the config. > > > > for example: > > > > function test(int asn) { > > > > [ do something general ] > > > > include "/etc/bird/" . asn . "-special.conf"; > > > > } > > > > As this approach doesn't work, is there currently an possibility to do > > such includes somehow? > > > > regards, > > tim > > > > Hi! > > It should be possible to use the case switch to explicitely include > these files, one by one. It is also needed to reload the config on every > change. > > case asn { > 65500: include "/etc/bird/65500-special.conf"; > 65511: include "/etc/bird/65511-special.conf"; > ... > }
Hi Note that include is a preprocessor operation unrelated to the filter language, so in /etc/bird/65500-special.conf you would have to use { .. } to have a proper block. Also note that the current grammar require include to be on a new line, so you would have to use: case asn { 65500: include "/etc/bird/65500-special.conf"; 65511: include "/etc/bird/65511-special.conf"; ... } And finally, you could simply use wildcards: case asn { include "/etc/bird/*-special.conf"; } And then in in each file the appropriate case branch, like this for /etc/bird/65500-special.conf: 65500: { ... } -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santi...@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."