Thursday, 25 October 2012 20:40

Simple BASH script like irccat

This simple script reads a pipe and waits for the EOF then dumps it all out to a IRC server via netcat.

#!/bin/sh
IRCUSER="GANDALF"
IRCNICK="GANDALF"
IRCCHAN="General"
IRCHOST="localhost"
IRCPORT="6667"
irc="USER $IRCUSER * 8 : $IRCUSER Robot\n"
irc+="NICK $IRCNICK\n"
irc+="JOIN #$IRCCHAN\n"
while read mes; do
irc+="NOTICE #General : $mes\n"
done;
irc+="QUIT :Bye for now\n"
echo -e "${irc[*]}" | nc $IRCHOST $IRCPORT
Last modified on Thursday, 25 October 2012 21:01

Related items

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.