CORD GUI - Define runtime properties 'headnodeip' and 'headnodeport'.
- put scripts (pullwar.sh, run.me, stop.me) under revision control.

Change-Id: I58078e8134d643d976271b60fe80ff28f9458ca9
diff --git a/apps/demo/cord-gui/src/scripts/pullwar.sh b/apps/demo/cord-gui/src/scripts/pullwar.sh
new file mode 100644
index 0000000..e015e1c
--- /dev/null
+++ b/apps/demo/cord-gui/src/scripts/pullwar.sh
@@ -0,0 +1 @@
+cp $ONOS_ROOT/apps/demo/cord-gui/target/cord-gui-1.2.0-SNAPSHOT.war .
diff --git a/apps/demo/cord-gui/src/scripts/run.me b/apps/demo/cord-gui/src/scripts/run.me
new file mode 100644
index 0000000..85bf294
--- /dev/null
+++ b/apps/demo/cord-gui/src/scripts/run.me
@@ -0,0 +1,32 @@
+#######------------------------------------------------------------
+# CORD Demo
+# =========
+
+export JETTY="-jar jetty-runner.jar"
+export CORD=./cord-gui-1.2.0-SNAPSHOT.war
+export LOGDBG=-Dorg.onosproject.cord.gui.LEVEL=DEBUG
+export DEBUG="-Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n"
+export LOG=cord.log
+
+IP="$1"
+PORT="$2"
+
+if [ ! -z "$IP" ]
+then
+  PARAM1="-Dheadnodeip=$IP"
+else
+  PARAM1=""
+fi
+
+if [ ! -z "$PORT" ]
+then
+  PARAM2="-Dheadnodeport=$PORT"
+else
+  PARAM2=""
+fi
+
+java $PARAM1 $PARAM2 $LOGDBG $JETTY $CORD >$LOG 2>&1 &
+#java $PARAM1 $PARAM2 $LOGDBG $DEBUG $JETTY $CORD >$LOG 2>&1 &
+
+echo jetty-runner started {$PARAM1:$PARAM2}
+echo .. logging to $LOG
diff --git a/apps/demo/cord-gui/src/scripts/stop.me b/apps/demo/cord-gui/src/scripts/stop.me
new file mode 100644
index 0000000..331d9bb
--- /dev/null
+++ b/apps/demo/cord-gui/src/scripts/stop.me
@@ -0,0 +1,18 @@
+# script to stop the cord gui server
+#
+PID=$(ps | grep jetty-runner | grep -v grep | cut -c1-5)
+if [ -z "$PID" ]
+then
+  echo jetty-runner not running
+  exit 0
+fi
+kill $PID
+sleep 1
+
+PID=$(ps | grep jetty-runner | grep -v grep | cut -c1-5)
+if [ ! -z "$PID" ]
+then
+  echo jetty-runner still running ?
+else
+  echo jetty-runner stopped
+fi