2015-12-22 13:23:18 -07:00
|
|
|
#!/bin/bash
|
2016-04-04 14:37:21 -07:00
|
|
|
PREFIX_ARGS=""
|
|
|
|
CMD_ARGS=""
|
|
|
|
while [[ $# -gt 0 ]]; do
|
|
|
|
arg=$1
|
|
|
|
shift
|
|
|
|
case ${arg} in
|
|
|
|
--prefix|-p)
|
|
|
|
PREFIX_ARGS="chroot prefix ${1}"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
CMD_ARGS="$CMD_ARGS ${arg}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "x${CMD_ARGS}" != "x" ]; then
|
|
|
|
echo exec ${CMD_ARGS} | vpp_api_test $PREFIX_ARGS | sed 's/vat# //g'
|
2016-01-18 10:12:53 -07:00
|
|
|
else
|
|
|
|
echo -n "vpp# "
|
|
|
|
while read CMD; do
|
2016-01-25 18:52:58 -07:00
|
|
|
if [ "x$CMD" == "xexit" ]; then
|
|
|
|
exit
|
|
|
|
elif [ "x$CMD" != "x" ]; then
|
2016-04-04 14:37:21 -07:00
|
|
|
echo exec $CMD | vpp_api_test $PREFIX_ARGS| sed 's/vat# //g'
|
2016-01-25 18:52:58 -07:00
|
|
|
fi
|
|
|
|
echo -n "vpp# "
|
2016-01-18 10:12:53 -07:00
|
|
|
done
|
|
|
|
fi
|