File: parsing

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 (53 lines) | stat: -rwxr-xr-x 902 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh

set +e

dirname=`dirname $0`
retval=0

case $dirname in
	/*)
		cd $dirname/../.. > /dev/null
		path=`pwd`
		cd - > /dev/null
	;;
	*)
		cd `pwd`/$dirname/../.. > /dev/null
		path=`pwd`
		cd - > /dev/null
	;;
esac

export PYTHONPATH=$path/lib

cd $path/etc/exabgp
names=`ls *.conf`
cd -

echo $names

export exabgp_tcp_bind=''
export exabgp_debug_selfcheck=true

for conf in $names
do
	printf "%-50s " $conf
	result=`$path/sbin/exabgp $path/etc/exabgp/$conf 2>&1`
	retcode=$?
	problem=`echo $result | grep 'Problem with the configuration file' || true`

	if [ $retcode -eq 0 ] && [ "$problem" = "" ]
	then
		printf "ok\n"
	else
		printf "failed\n"
		printf "\n"
		printf "env exabgp_debug_configuration=true exabgp_tcp_bind='' exabgp_debug_selfcheck=true $path/sbin/exabgp -d -p $path/etc/exabgp/$conf 2>&1"
		printf "\n\n"
		printf "$result"
		printf "\n\n"
		retval=1
	fi
done

exit $retval