bandie
By: a guest | Mar 19th, 2010 | Syntax:
Bash | Size: 0.97 KB | Hits: 50 | Expires: Never
#!/bin/bash
case "$1" in
in)
while read irccmd recipent post; do
post=${post:1:$((${#post}-2))}
if [ "$irccmd" = "PRIVMSG" -a "$recipent" = "$cli_irc_user" ]; then
echo "$post"
fi
done
;;
middle)
bash
;;
out)
#awk "{print \":$cli_irc_user PRIVMSG $nickname :\" \$0}"
while read oneline; do
echo ":$cli_irc_user PRIVMSG $nickname :$oneline"
done
;;
*)
#export cli_irc_user="bash"
#export cli_irc_user="`whoami`@`hostname`"
export cli_irc_user="`hostname`"
export cli_irc_room="&bash"
export t_welcome="Type bash commands! Use \`<<EOF' syntax for interactive ones."
read irccmd nickname
export nickname
read irccmd username clienthost serverhost realname
export realname=${realname:1:$((${#realname}-1))}
#echo ":$nickname JOIN $cli_irc_room"
#echo ":localhost MODE $cli_irc_room +t"
#echo ":localhost 332 $nickname $cli_irc_room :$t_welcome"
echo ":$cli_irc_user PRIVMSG $nickname :$t_welcome"
### ElA!gazA!s
$0 in | $0 middle 2>&1 | $0 out
;;
esac