added demos to the repo
[groupbasedpolicy.git] / demos / gbpsfc-env / resetcontroller.sh
diff --git a/demos/gbpsfc-env/resetcontroller.sh b/demos/gbpsfc-env/resetcontroller.sh
new file mode 100644 (file)
index 0000000..ac72564
--- /dev/null
@@ -0,0 +1,11 @@
+hostnum=${HOSTNAME#"gbpsfc"}
+sw="sw$hostnum"
+echo "Deleting controller for $sw"
+ovs-vsctl del-controller $sw;
+if [[ $? -ne 0 ]] ; then
+    exit 1
+fi
+echo "Sleeping for 6sec..."
+sleep 6
+echo "Setting controller to $ODL"
+ovs-vsctl set-controller $sw tcp:$ODL:6653