From 372c635714f6e7de8a0da135980697b49f207f2c Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 4 Oct 2024 09:29:21 -0700 Subject: wip socket communication --- listener.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 listener.sh (limited to 'listener.sh') diff --git a/listener.sh b/listener.sh new file mode 100755 index 00000000..1d68bb4a --- /dev/null +++ b/listener.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Check if the socket file exists +if [ -S /sockets/ctrl ]; then + echo "Socket exists. Unlinking..." + rm /sockets/ctrl +fi + +# Start socat +socat UNIX-LISTEN:/sockets/ctrl,reuseaddr,fork SYSTEM:'sh -c "cat | while read line; do output=\$(eval \$line 2>&1); echo \$output; done"' + -- cgit v1.2.3