#!/bin/bash
IRC_SERVER='irc.freenode.net'
IRC_PORT=6667
IRC_USERNAME='h4'
IRC_FULLNAME='h4'
IRC_NICK='h4'
IRC_CHANNEL='#h4'
send_irc_message() {
message=$1
echo -e "USER $IRC_USERNAME 8 * : $IRC_FULLNAME\nNICK $IRC_NICK\nJOIN $IRC_CHANNEL\nPRIVMSG :$IRC_CHANNEL $1\nQUIT\n" | nc $IRC_SERVER $IRC_PORT
}
send_irc_message test
References :
ubuntu - Send message to IRC channel from bash - Server Fault
Nunca — Sending messages to an IRC server from a shell script (Bash)
訊息空格問題
sockets - IRC BOT (python) - Stack Overflow
沒有留言:
張貼留言