Merge branch 'work.file' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-2.6-microblaze.git] / samples / pktgen / functions.sh
index dae06d5..a335393 100644 (file)
@@ -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 --