Syndicate for Bash
🙂 Really! The Syndicate network protocol is simple, easily within reach of a
shell script plus e.g. netcat
or openssl
.
Here’s the code so far. The heart of it is about 90 SLOC, showing how easy it can be to interoperate with a Syndicate ecosystem.
Instructions are in the README, if you’d like to try it out!
The code so far contains functions to interact with a Syndicate server along with a small demo, which implements an interactive chat program with presence notifications.
Because Syndicate’s network protocol is polyglot, and the bash demo uses generic chat assertions, the demo automatically interoperates with other implementations, such as the analogous python chat demo.
The next step would be to factor out the protocol implementation from
the demo and come up with a simple make install
step to make it
available for system scripting.
I actually have a real use for this: it’ll be convenient for
implementing simple system monitoring services as part of a
Syndicate-based system layer. Little bash
script services could easily publish the battery charge level, screen
brightness level, WiFi connection status, etc. etc., by reading files
from /sys
and publishing them to the system-wide Syndicate server
using this library.