string shell pattern match

Robert Sander r.sander at heinlein-support.de
Fri Jun 14 14:06:25 CEST 2019


On 14.06.19 13:49, Hansen, Christoffer wrote:

> So if you create an function to check if the interface name matches a
> certain pattern. And in your if() statement matched against true/false
> return value of function. You should be able to do what you want.

This does not work neither:

function if_external(string ifnamestr)
{
  if ifnamestr ~ "bond0.4[2345]" then return true;
  return false;
}

and later:

export filter {
  if if_external(ifname) then reject;
}

Regards
-- 
Robert Sander
Heinlein Support GmbH
Schwedter Str. 8/9b, 10119 Berlin

https://www.heinlein-support.de

Tel: 030 / 405051-43
Fax: 030 / 405051-19

Amtsgericht Berlin-Charlottenburg - HRB 93818 B
Geschäftsführer: Peer Heinlein - Sitz: Berlin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20190614/d56a6219/attachment.sig>


More information about the Bird-users mailing list