]> git.zerfleddert.de Git - fhem-stuff/commitdiff
CUL stuff for OpenWRT
authorMichael Gernoth <michael@gernoth.net>
Mon, 3 Jun 2013 18:06:28 +0000 (20:06 +0200)
committerMichael Gernoth <michael@gernoth.net>
Mon, 3 Jun 2013 18:06:28 +0000 (20:06 +0200)
CUL/20-cul.OpenWRT [new file with mode: 0644]
CUL/culd [new file with mode: 0755]

diff --git a/CUL/20-cul.OpenWRT b/CUL/20-cul.OpenWRT
new file mode 100644 (file)
index 0000000..5dce6c8
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+if [ "${PRODUCT:0:8}" = "3eb/204b" ]; then
+       logger "CUL: ${ACTION} ${PRODUCT}"
+
+       case "$ACTION" in
+               add)
+                       if [ "`pidof culd`" = "" ]; then
+                               logger "Starting culd"
+                               /usr/sbin/culd &
+                       fi
+                       ;;
+               remove)
+                       if [ "`pidof culd`" != "" ]; then
+                               logger "Stopping culd"
+                               killall culd
+                               killall socat
+                       fi
+                       ;;
+       esac
+fi
diff --git a/CUL/culd b/CUL/culd
new file mode 100755 (executable)
index 0000000..b1cae3d
--- /dev/null
+++ b/CUL/culd
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+DEVICE=/dev/ttyACM0,b9600
+PORT=2323
+#OPTIONS="-ly -lh"
+#OPTIONS="-v -x"
+
+while true; do
+       echo "Listening on port ${PORT} for new connection requests"
+       socat ${OPTIONS} "${DEVICE},echo=0" "TCP-LISTEN:${PORT},reuseaddr"
+done
Impressum, Datenschutz