Commit ec171ab7 authored by Ondřej Zajíček's avatar Ondřej Zajíček

Merge remote-tracking branch 'origin/master' into mh-bird_tables

parents 01f5abeb 4f08efe3
#!/bin/bash
if [ -f $COMMON/bird ]
then
......@@ -16,6 +17,27 @@ sysctl net.mpls.platform_labels=1024
fi
ulimit -c unlimited
./bird -l -P bird.pid
#./bird -c bird.conf -s bird.ctl
BIRD_CMD="./bird"
if $BIRD_DEBUG; then
BIRD_ARGS="-l -P bird.pid -dD bird.debug"
BIRD_BG=true
else
BIRD_ARGS="-l -P bird.pid"
BIRD_BG=false
fi
run_bird() {
if [ -z "${VALGRIND_ARGS}" ]; then
${BIRD_CMD} ${BIRD_ARGS}
else
valgrind --log-file=bird.valgrind ${VALGRIND_ARGS} ${BIRD_CMD} ${BIRD_ARGS}
fi
}
if ${BIRD_BG}; then
run_bird &
else
run_bird
fi
......@@ -2,23 +2,47 @@
set -e
while getopts ":c:h:" OPTION; do
showhelp() {
echo -e "USAGE: $0 [-c <cf-ospf|cf-babel|...> ]"
echo
echo -e "\t-d\t\tenable BIRD debug mode"
echo -e "\t-V \"args\"\trun Valgrind with these args"
echo -e "\t-h\t\tshow this help"
}
while getopts ":c:hdV:" OPTION; do
case "${OPTION}" in
c)
CONF=${OPTARG}
if [ -d "$CONF" ]; then
echo -e "Creating symlink config --> $CONF\n"
ln -s "${CONF}" config
. netlab_lib
. config/config
else
echo "Incorrect name of protocol"
fi
;;
h|--h)
echo -e "USAGE: $0 [-c <cf-ospf|cf-babel|...> ]\n"
d)
export BIRD_DEBUG=true
;;
V)
export VALGRIND_ARGS="${OPTARG}"
;;
h)
showhelp
exit 0
;;
*)
showhelp
exit 2
;;
esac
done
if [ -z "${CONF}" ]; then
showhelp
exit 2
fi
. netlab_lib
. config/config
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment