added demos to the repo
[groupbasedpolicy.git] / demos / gbpsfc-env / dumpflows.sh
diff --git a/demos/gbpsfc-env/dumpflows.sh b/demos/gbpsfc-env/dumpflows.sh
new file mode 100644 (file)
index 0000000..ba8f271
--- /dev/null
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+
+set -e
+hostnum=${HOSTNAME#"gbpsfc"}
+sw="sw$hostnum"
+
+TABLE=$1
+
+clear
+ovs-ofctl dump-groups $sw -OOpenFlow13
+if [ "$TABLE" ]
+then
+        ovs-ofctl dump-flows $sw -OOpenFlow13 table=$TABLE
+else
+        ovs-ofctl dump-flows $sw -OOpenFlow13
+fi
+