From e939511acbb16cda3dab34fe255160ae7ae19258 Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Sun, 21 Aug 2016 23:22:19 +0300 Subject: Check if interfaces are in use at binding/unbinding/starting TRex. --- scripts/trex-cfg | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts/trex-cfg') diff --git a/scripts/trex-cfg b/scripts/trex-cfg index 02421001..55eb18fb 100755 --- a/scripts/trex-cfg +++ b/scripts/trex-cfg @@ -65,5 +65,15 @@ fi # try to bind the ports from the configuration file (new DPDK) PARENT_ARGS="$0 $@" -(/usr/bin/python -V &> /dev/null && ./dpdk_setup_ports.py --parent "$PARENT_ARGS") || - (/usr/bin/python3 -V &> /dev/null && /usr/bin/python3 dpdk_setup_ports.py --parent "$PARENT_ARGS") || exit 1 + +if /usr/bin/python -V &> /dev/null; then + ./dpdk_setup_ports.py --parent "$PARENT_ARGS" +elif /usr/bin/python3 -V &> /dev/null; then + /usr/bin/python3 dpdk_setup_ports.py --parent "$PARENT_ARGS" +elif python -V &> /dev/null; then + python ./dpdk_setup_ports.py --parent "$PARENT_ARGS" +else + echo "Could not find python to run dpdk_setup_ports.py script" + exit 1 +fi + -- cgit 1.2.3-korg