aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-api-test/scripts/vppctl
blob: f4062b64f204c58d6f6c506cd0e3bcca9326389c (plain)
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
#!/bin/bash
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'
else
    echo -n "vpp# "
    while read CMD; do
        if [ "x$CMD" == "xexit" ]; then
            exit
        elif [ "x$CMD" != "x" ]; then
            echo exec $CMD | vpp_api_test $PREFIX_ARGS| sed 's/vat# //g'
        fi
        echo -n "vpp# "
    done
fi