summaryrefslogtreecommitdiffstats
path: root/scripts/trex-cfg
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-08-21 23:22:19 +0300
committerYaroslav Brustinov <ybrustin@cisco.com>2016-08-21 23:22:19 +0300
commite939511acbb16cda3dab34fe255160ae7ae19258 (patch)
tree529e3df8b1e4ac7f8a406861cd23eba0f6d5f46a /scripts/trex-cfg
parent5f9c0e65223f26de99958260420601670df4e012 (diff)
Check if interfaces are in use at binding/unbinding/starting TRex.
Diffstat (limited to 'scripts/trex-cfg')
-rwxr-xr-xscripts/trex-cfg14
1 files changed, 12 insertions, 2 deletions
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
+