Update Honeycomb to Rel1810 for vFW
[demo.git] / vnfs / vFW / scripts / enable_disable_streams.sh
diff --git a/vnfs/vFW/scripts/enable_disable_streams.sh b/vnfs/vFW/scripts/enable_disable_streams.sh
new file mode 100644 (file)
index 0000000..d255155
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+if [ -z $1 ]; then
+  echo "Missing number of streams to enable. Exit (1)"
+  exit
+fi
+
+if [ "$1" -gt "10" ] || [ "$1" -lt "1" ]; then
+  echo "The number of streams to enable must be between 1 and 10. Exit(1)"
+  exit
+fi
+
+STREAMS=$1
+
+# Disable all the streams
+vppctl packet-generator disable-stream
+
+# Enable streams based on client input
+for((i=1; i <= $STREAMS; i++)); do
+  vppctl packet-generator enable-stream fw_udp$i
+done
\ No newline at end of file