irctk

libircclient binding for scripts
git clone https://a3nm.net/git/irctk/
Log | Files | Refs | README

ajoin.sh (583B)


      1 #!/bin/bash
      2 
      3 trap 'kill $(jobs -p)' EXIT
      4 
      5 mkdir -p ajoin
      6 cd ajoin
      7 
      8 seq 3 | sed 's/.*/[#ajoin_test] <ajoino&> &/' > ref
      9 (echo '/mode +n'; tail -f /dev/null) |
     10   ../../irctk ajoini@localhost \#ajoin_test > heard &
     11 PID=$!
     12 sleep 1
     13 echo 1 |
     14   ../../irctk -J ajoino1@localhost \#ajoin_test \#ajoin_testb
     15 sleep 1
     16 echo '[#ajoin_test] 2' |
     17   ../../irctk ajoino2@localhost \#ajoin_testb
     18 sleep 1
     19 echo 3 |
     20   ../../irctk -l ajoino3@localhost \#ajoin_testb \#ajoin_test
     21 sleep 1
     22 echo '[#ajoin_test] 4' |
     23   ../../irctk -J ajoino4@localhost \#ajoin_testb 2>/dev/null
     24 sleep 1
     25 kill $PID
     26 diff ref heard