21 ms·
I wrote this for use on a client project for a client I'm pretty sure won't consider this a breach of anything. #!/bin/bash # Simple chat system for wh
by kragen 11y ago
I wrote this for use on a client project for a client I'm pretty sure won't consider this a breach of anything.
#!/bin/bash
# Simple chat system for when Skype is fucked.
nick=${1?Usage: $0 nickname (e.g. $0 biturd)}
chan=/tmp/yapchan
echo "^D to exit chat." >&2
tail -F "$chan" & tailpid=$!
trap 'kill "$tailpid"' 0
while IFS='' read -er line; do echo "<$nick> $line"; done >> "$chan"
If you're running this with multiple accounts, you may need to chmod a+w /tmp/yapchan, and if you're using MacOS on the server, you may need to use a different filename since MacOS has a per-user private /tmp.
- kragen 11y agoIf anybody is using this and encounters bugs, I’d be happy to hear them. I did my best to make it work reliably.