summaryrefslogtreecommitdiffstats
path: root/run.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'run.sh.in')
-rwxr-xr-xrun.sh.in49
1 files changed, 49 insertions, 0 deletions
diff --git a/run.sh.in b/run.sh.in
new file mode 100755
index 0000000..065d7f6
--- /dev/null
+++ b/run.sh.in
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# json dbus bridge
+#
+# Copyright (c) 2010 by Michael Olbrich <m.olbrich@pengutronix.de>
+#
+# To the extent possible under law, Pengutronix e.K. has waived all copyright
+# and related or neighboring rights to JSON-DBus-Bridge Demo Code.
+#
+
+finish() {
+ kill $hello_pid
+ kill $lighttpd_pid
+ exit
+}
+
+trap finish SIGINT
+
+"@abs_srcdir@/services/python/hello-world.py" &
+hello_pid=$!
+
+@LIGHTTPD@ -f "@abs_builddir@/lighttpd/lighttpd.conf" -D &
+lighttpd_pid=$!
+
+echo -n "waiting for lighttpd "
+for i in `seq 10`; do
+ sleep 1
+ echo -n "."
+ wget -e no_proxy=localhost -O - -q http://localhost:8080/hello-world/source/ > /dev/null && break
+done
+
+if [ $? -ne 0 ]; then
+ echo
+ echo
+ echo starting lighttpd failed!
+ finish
+ exit 1
+else
+ echo
+ echo
+ echo lighttpd sucessfully started.
+ echo
+ echo The demo page can be view at http://localhost:8080/
+fi
+
+while [ 1 ]; do
+ sleep 100
+done
+