check for the existence of a variable
1 Oct
2014
1 Oct
'14
1:09 p.m.
Hi, I want to be able to include a file which will normally have a constant but in some cases it may not have any content, but I still want to be able to restart/reload without problems. Here is a snippet: include "/etc/bird.d/anycast_prefixes.conf"; function anycast_advertise() { if defined(ACAST_PS_ADVERTISE) then return net ~ ACAST_PS_ADVERTISE; else { return false; } } The content of /etc/bird.d/anycast_prefixes.conf is define ACAST_PS_ADVERTISE = [ 192.168.200.1/32, # Frontend 1 192.168.200.2/32 # Frontend 2 ]; The defined function complains about missing variables. Is it possible to express what I want? Thanks, Pavlos
4274
Age (days ago)
4274
Last active (days ago)
0 comments
1 participants
participants (1)
-
Pavlos Parissis