File: exabgpcli

package info (click to toggle)
exabgp 4.2.25-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,612 kB
  • sloc: python: 37,482; sh: 581; perl: 31; makefile: 23
file content (25 lines) | stat: -rwxr-xr-x 563 bytes parent folder | download | duplicates (4)
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
#!/bin/sh

path="$(cd "$(dirname "$0")"/.. ; pwd)"

export PYTHONPATH="$path"/lib

for INTERPRETER in "$INTERPRETER" python3 pypy3; do
    INTERPRETER="$(command -v "$INTERPRETER")" && break
done

if [ "$INTERPRETER" = "" ]; then
	echo "ExaBGP could not find a python3 interpreter"
	exit 1
fi

APPLICATION="$("$INTERPRETER" -c "
import sys
import os

print([os.path.join(_, 'exabgp', 'application', 'cli.py')
       for _ in sys.path
       if os.path.isfile('/'.join((_, 'exabgp', 'application', 'cli.py')))][0]
)")"

exec env "$INTERPRETER" "$APPLICATION" "$@"