From d1ff840a7be5e9be238f303f289bcf80fa3cebba Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Mon, 3 Jun 2013 20:06:28 +0200 Subject: [PATCH 1/1] CUL stuff for OpenWRT --- CUL/20-cul.OpenWRT | 21 +++++++++++++++++++++ CUL/culd | 11 +++++++++++ 2 files changed, 32 insertions(+) create mode 100644 CUL/20-cul.OpenWRT create mode 100755 CUL/culd 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 -- 2.39.5