diff --git a/bot.sh b/bot.sh index f04399c..067b80d 100755 --- a/bot.sh +++ b/bot.sh @@ -7,11 +7,14 @@ echo "NICK $nick" > $config echo "USER $user" >> $config echo "JOIN #$channel" >> $config -tail -f $config | telnet $server 6667 | while read res; do +tail -f $config | telnet $server 6667 | while read res; +do + # do things when you see output case "$res" in PING*) echo "$res" | sed "s/PING/PONG/" >> $config ;; + # for pings on nick/user *"You have not"*) echo "JOIN #$channel" >> $config ;;