I have installed ircd-hybrid
on my Ubuntu Server (192.168.1.2, example.com).
We use #teamchannel
to communicate inside the team.
The question is: how can I send some short message from example.com
to #teamchannel
from the bash script? e.g. example.com: Alert! The server is rebooting now
Edit:
I have found a perl script which does exactly what I needed.
IRC is a simple text and line oriented protocol, so it can be done with the basic linux tools. So, without installing
ii
:In this command,
nc
does the network connection, and you send a login info, nick, join a channel named "#channel" amd send a message "Ahoj lidi!" to that channel. And quit the server.use console irc client
One solution would be to use expect to script communication with the IRC server using a telnet client.
If you need to supply a password and use ssl you can do something like this.
The script should be run like this:
This is similar to an earlier example using
nc
but I found I had to usencat
to get it working with our IRC server which has been set up with SSL.