-
Notifications
You must be signed in to change notification settings - Fork 25
Description
there is this home automation service "fhem" that is widely used in Germany. We have managed to integrate your cmdline tool in a way, that your home can send status updates to your phone via signal.. A fellow user raised the question, if it'd be possible to have a bidirectional communication via signal.
We have come up with the following solution, that works.
/opt/textsecure/bin/textsecure -to="+49157xxxxxxxxx" | while read line; do mes=$(echo $line| sed -r "s/\x1B\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g" | awk '{ print substr($0, index($0,$5)) }'); $process_in_other_application $mes ; done
As you can see, we need to filter out the color-codes (sed) and suppress columns 1-4 in order to receive the plain responses and act on it.
It'd be much easier, if you could add a -raw cmd-line switch that only outputs the plain message.
Additionally someone could easily tunnel a telnet or ssh session through signal, if the additional characters could be suppressed.
The following almost works, but the color-codes and other text are problematic.
mkfifo ts
nc server 23 < ts | /opt/textsecure/bin/textsecure -raw -to="+4915xxxx" > ts
It might seem purely cosmetic, but it would make shell integration much easier, if you could implement that raw mode.