From: Michael Gernoth Date: Mon, 3 Jun 2013 18:06:28 +0000 (+0200) Subject: CUL stuff for OpenWRT X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/fhem-stuff/commitdiff_plain/d1ff840a7be5e9be238f303f289bcf80fa3cebba CUL stuff for OpenWRT --- diff --git a/CUL/20-cul.OpenWRT b/CUL/20-cul.OpenWRT new file mode 100644 index 0000000..5dce6c8 --- /dev/null +++ b/CUL/20-cul.OpenWRT @@ -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 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