summaryrefslogtreecommitdiff
path: root/samples/pktgen/functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'samples/pktgen/functions.sh')
-rw-r--r--samples/pktgen/functions.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/samples/pktgen/functions.sh b/samples/pktgen/functions.sh
index dae06d5b38fa..a335393157eb 100644
--- a/samples/pktgen/functions.sh
+++ b/samples/pktgen/functions.sh
@@ -108,7 +108,12 @@ function pgset() {
fi
}
-[[ $EUID -eq 0 ]] && trap 'pg_ctrl "reset"' EXIT
+if [[ -z "$APPEND" ]]; then
+ if [[ $EUID -eq 0 ]]; then
+ # Cleanup pktgen setup on exit if thats not "append mode"
+ trap 'pg_ctrl "reset"' EXIT
+ fi
+fi
## -- General shell tricks --