irctk

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

password.sh (475B)


      1 #!/bin/bash
      2 
      3 trap 'kill $(jobs -p)' EXIT
      4 
      5 mkdir -p password
      6 cd password
      7 
      8 (echo -e "/mode +n\n/mode +k hunter2"; tail -f /dev/null) |
      9   ../../irctk passwordo@localhost \#password_test:useless > heard &
     10 PID=$!
     11 sleep 2
     12 echo ok | ../../irctk passwordy@localhost \#password_test:hunter2 2>/dev/null >/dev/null
     13 echo ko | ../../irctk passwordn@localhost \#password_test:hunter3 2>/dev/null >/dev/null
     14 sleep 2
     15 kill $PID
     16 grep "ok" heard > /dev/null && grep -v "ko" heard > /dev/null
     17