summaryrefslogtreecommitdiffstats
path: root/scripts/trex-cfg
diff options
context:
space:
mode:
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
+