summaryrefslogtreecommitdiffstats
path: root/scripts/t-rex-64
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-10-30 16:10:59 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-10-30 21:00:40 +0200
commitf5817145486df18f92072212117a713cec1e4219 (patch)
treee15cc4f8cf54eaaa9d166b6d750c002dffda7a1f /scripts/t-rex-64
parent599f4ecd1a2e9fdbe53a848b1dad71a08a67e048 (diff)
add ifdef guard to .h file
remove UUID from TUI STF Python API: show newlines instead of "\n\n\n" in Exception message STF Python API: remove "During handling of the above exception, another exception occurred:" in Python3.3+ dpdk_nic_bind.py: ensure needed PATH exists for lspci etc. t-rex-64: remove "stty: standard input: Inappropriate ioctl for device" t-rex-64: remove "cat: write error: Broken pipe" Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'scripts/t-rex-64')
-rwxr-xr-xscripts/t-rex-6416
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/t-rex-64 b/scripts/t-rex-64
index 4d0d7813..d2388cfd 100755
--- a/scripts/t-rex-64
+++ b/scripts/t-rex-64
@@ -24,9 +24,16 @@ done <<< "$($PYTHON dpdk_setup_ports.py --dump-pci-description)"
cd $(dirname $0)
export LD_LIBRARY_PATH=$PWD
-saveterm="$(stty -g)"
+
+if [ -t 0 ] && [ -t 1 ]; then
+ export is_tty=true
+ saveterm="$(stty -g)"
+else
+ export is_tty=false
+fi
+
# if we have a new core run optimized trex
-if cat /proc/cpuinfo | grep -q avx ; then
+if grep -q avx /proc/cpuinfo ; then
./_$(basename $0) $INPUT_ARGS
RESULT=$?
if [ $RESULT -eq 132 ]; then
@@ -40,7 +47,10 @@ else
./_t-rex-64-o $INPUT_ARGS
RESULT=$?
fi
-stty $saveterm
+
+if $is_tty; then
+ stty $saveterm
+fi
if [ $RESULT -ne 0 ]; then
exit $RESULT