Hi all,
is there a way to @load a script in bro only if the file exists?
My scenario is that I'd like to be able to include configuration data from, e.g., /etc/bro-config.bro. But this script might not exist in all scenarios. Loading it via @load gives an error if the file doesn't exist.
I've tried to use @prefixes to conditionally load scripts, but couldn't figure out exactly where bro would be searching for those scripts.
If there an equivalent for something like "if [-f /etc/bro-config.bro] " ?
Best regards,
Dirk
I've tried to use @prefixes to conditionally load scripts, but couldn't
figure out exactly where bro would be searching for those scripts.
I think that prefixes are probably exactly what you’re looking for. If you add a prefix and then create a file by the right name it will only load it when it finds the file. This is a little tricky with the current setup unfortunately, I didn’t get this setup quite the way I wanted to a number of years ago.
If you write a file named “local.local.bro” to your site/ directory, that script will automatically load if it’s found.
If there an equivalent for something like "if [-f /etc/bro-config.bro] " ?
Not really.
.Seth