File: get-bro-env

package info (click to toggle)
bro-aux 0.42-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, trixie
  • size: 1,104 kB
  • sloc: sh: 999; ansic: 943; ruby: 71; makefile: 68; perl: 35; cpp: 26
file content (36 lines) | stat: -rwxr-xr-x 1,046 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /bin/sh
#
# BTest helper for getting values for Bro-related environment variables.

base=`dirname $0`
bro_dist=`cat ${base}/../../build/CMakeCache.txt | grep BRO_DIST | cut -d = -f 2`

if [ -n "${bro_dist}" ]; then
    if [ "$1" = "bropath" ]; then
        ${bro_dist}/build/bro-path-dev
    elif [ "$1" = "bro_plugin_path" ]; then
        ( cd ${base}/../.. && pwd )
    elif [ "$1" = "path" ]; then
        echo ${bro_dist}/build/src:${bro_dist}/aux/btest:${base}/:${bro_dist}/aux/bro-cut:$PATH
    else
        echo "usage: `basename $0` <var>" >&2
        exit 1
    fi
else
    # Use Bro installation for testing. In this case bro-config must be in PATH.
    if ! which bro-config >/dev/null; then
        echo "bro-config not found" >&2
        exit 1
    fi

    if [ "$1" = "bropath" ]; then
        bro-config --bropath
    elif [ "$1" = "bro_plugin_path" ]; then
        ( cd ${base}/../.. && pwd )
    elif [ "$1" = "path" ]; then
        echo ${PATH}
    else
        echo "usage: `basename $0` <var>" >&2
        exit 1
    fi
fi