irctk

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

nick.sh (587B)


      1 #!/bin/bash
      2 
      3 trap 'kill $(jobs -p)' EXIT
      4 
      5 mkdir -p nick
      6 cd nick
      7 mkfifo fifo{1,2,3} 2>/dev/null
      8 
      9 seq 3 | sed 's/^/[#nick_testb] <nickin__> /' > ref
     10 cat fifo1 | ../../irctk nickin@localhost \#nick_testb > heard1 &
     11 PID1=$!
     12 sleep 1
     13 cat fifo2 | ../../irctk nickin@localhost > heard2 2>error2 &
     14 PID2=$!
     15 sleep 1
     16 cat fifo3| ../../irctk nickout@localhost \#nick_test > heard3 2>error3 &
     17 PID3=$!
     18 sleep 1
     19 seq 3 | ../../irctk -o nickin@localhost \#nick_testb > heard4 2>error4
     20 sleep 1
     21 kill $PID1 $PID2 $PID3
     22 diff ref heard1 && diff ref heard4 \
     23   && grep -q taken error2 \
     24   && grep -q taken error4