我已经在我的Ubuntu上安装了ircd-hybrid (192.168.1.2,example.com)。
我们使用#teamchannel在团队内部进行通信。
问题是:我如何从bash脚本从example.com向#teamchannel发送一些短消息?例如example.com: Alert! The server is rebooting now
我找到了perl脚本,它正是我所需要的。
发布于 2010-09-21 13:25:28
使用控制台irc客户端
apt-get install ii
ii -i /tmp -s 192.168.1.2
echo "/PRIVMSG #teamchannel example.com: Alert! The server is rebooting now" > /tmp/irc/in发布于 2011-04-14 22:18:47
IRC是一个简单的面向文本和面向行的协议,因此可以使用基本的linux工具来实现。因此,不安装ii:
echo -e 'USER bot guest tolmoon tolsun\nNICK bot\nJOIN #channel\nPRIVMSG #channel :Ahoj lidi!\nQUIT\n' \
| nc irc.freenode.net 6667在这个命令中,nc进行网络连接,然后发送登录信息nick,加入一个名为"# channel“的通道,并发送消息"Ahoj!”去那个频道。然后退出服务器。
发布于 2010-09-21 13:15:57
一种解决方案是使用期望编写使用telnet客户端与IRC服务器通信的脚本。
https://serverfault.com/questions/183157
复制相似问题