commit b773dcd51e5e38b279597e11fe854e75c4baf8bc parent 28ee2d1bf90cfcafc97793eaf39d3b11bdd99d58 Author: Josuah Demangeon <josuah.demangeon@gandi.net> Date: Tue, 8 Aug 2017 23:33:02 +0200 libbearssl/bin/bot: stupid bot that still does stuff Diffstat:
M | libbearssl/bin/bot | | | 28 | ++++++++++++++++++++++++++++ |
1 file changed, 28 insertions(+), 0 deletions(-)
diff --git a/libbearssl/bin/bot b/libbearssl/bin/bot @@ -1,4 +1,5 @@ DESC='a small git that prints bot status' +<<<<<<< HEAD HOST=unix.chat CHAN=#commits NICK=${0##*/} @@ -15,11 +16,35 @@ do sleep 1 printf 'PONG%s\n' "${line#PING}" > in printf 'PONG%s\n' "${line#PING}" +======= +NICK=giitboot #${0##*/} +CHAN='#commits' + +printf 'NickServ password: '; IFS='' read -r password + +[ -p in ] || mkfifo in + +while : # keep trying to connect +do + printf 'USER %s +i * :%s\nNICK %s\n' "$NICK" "$DESC" "$NICK" + printf 'PRIVMSG NickServ :IDENTIFY %s\n' "$password" + + tail -f in | while IFS='' read -r line + do + printf 'PRIVMSG %s :%s\n' "$CHAN" "$line" + done +done | brssl client unix.chat:6697 | while IFS='' read -r line +do + case "$line" in + ('PING :'*) + printf 'PONG :%s\n' "${line#PING :}" > in +>>>>>>> libbearssl/bin/bot: stupid bot that still does stuff ;; (*) printf '%s\n' "$line" ;; esac +<<<<<<< HEAD done & sleep 10 @@ -31,3 +56,6 @@ sleep 10 printf 'JOIN %s\n' "$CHAN" > in wait +======= +done +>>>>>>> libbearssl/bin/bot: stupid bot that still does stuff