diff options
author | defanor <defanor@uberspace.net> | 2017-04-29 04:36:01 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2017-04-29 04:36:01 +0300 |
commit | a06cc218bfa18943a46e051d5bbf463e1ddc0b6e (patch) | |
tree | d160d59dc14e0693ac8a304574dbf726b92850a0 /examples/chat/tlsd-chat.sh |
Initial commit
Diffstat (limited to 'examples/chat/tlsd-chat.sh')
-rwxr-xr-x | examples/chat/tlsd-chat.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/chat/tlsd-chat.sh b/examples/chat/tlsd-chat.sh new file mode 100755 index 0000000..a1064a4 --- /dev/null +++ b/examples/chat/tlsd-chat.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +NAME="${ALIAS}[$$]" + +quit () { + echo "$(date -u +%R) * ${NAME} quits" | nc localhost 7000 +} +trap quit EXIT + +JOINMSG="$(date -u +%R) * ${NAME} joins" +echo "${JOINMSG}" +echo "${JOINMSG}" | nc localhost 7000 +while read -r LINE +do echo "$(date -u +%R) ${NAME}: ${LINE}" +done | stdbuf -oL tr -d '\000-\011\013-\037' | nc localhost 7000 |