mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

For backward compatibility when reading values, we first check the ZEEK-prefixed value, and if not set, then check the corresponding BRO-prefixed value.
23 lines
546 B
Text
23 lines
546 B
Text
#
|
|
# @TEST-EXEC: zeek -b %INPUT
|
|
# @TEST-EXEC: btest-diff testfile
|
|
|
|
event zeek_init()
|
|
{
|
|
local vars: table[string] of string = { ["TESTBRO"] = "helloworld" };
|
|
|
|
# make sure the env. variable is not set
|
|
local myvar = getenv("ZEEK_ARG_TESTBRO");
|
|
if ( |myvar| != 0 )
|
|
exit(1);
|
|
|
|
# check if command runs with the env. variable defined
|
|
local a = system_env("echo $ZEEK_ARG_TESTBRO > testfile", vars);
|
|
if ( a != 0 )
|
|
exit(1);
|
|
|
|
# make sure the env. variable is still not set
|
|
myvar = getenv("ZEEK_ARG_TESTBRO");
|
|
if ( |myvar| != 0 )
|
|
exit(1);
|
|
}
|