Long ago, [snip]
It has lately come to my attention that this method is broken (and has been, for quite some time. Sure enough. It does not use any published inteerface) and that there is actually some demand for using it.
A version of pipeast that seems to work now is:
#!/bin/sh while read line; do
echo “$line” | tr ‘\n’ ‘\0’
done | nc -U /var/run/asterisk/asterisk.ctl
1. nc, or at least openbsd-netcat, can use unix domain sockets (-U).
No need for socat.
2. that /var/run is slowly converting to /run , though the
compatibility link /var/run will likely stay for quite some time.
3. If this script breaks in the future, you get to keep both pieces.
But this is only guaranteed if it breaks to exactly two pieces.