Share Pastebin
Guest
Public paste!

bandie

By: a guest | Mar 19th, 2010 | Syntax: Bash | Size: 0.97 KB | Hits: 50 | Expires: Never
Copy text to clipboard
  1. #!/bin/bash
  2.  
  3.  
  4. case "$1" in
  5. in)
  6. while read irccmd recipent post; do
  7. post=${post:1:$((${#post}-2))}
  8.  
  9. if [ "$irccmd" = "PRIVMSG" -a "$recipent" = "$cli_irc_user" ]; then
  10. echo "$post"
  11. fi
  12. done
  13. ;;
  14. middle)
  15. bash
  16. ;;
  17. out)
  18. #awk "{print \":$cli_irc_user PRIVMSG $nickname :\" \$0}"
  19. while read oneline; do
  20. echo ":$cli_irc_user PRIVMSG $nickname :$oneline"
  21. done
  22. ;;
  23. *)
  24. #export cli_irc_user="bash"
  25. #export cli_irc_user="`whoami`@`hostname`"
  26. export cli_irc_user="`hostname`"
  27. export cli_irc_room="&bash"
  28. export t_welcome="Type bash commands! Use \`<<EOF' syntax for interactive ones."
  29.  
  30. read irccmd nickname
  31. export nickname
  32. read irccmd username clienthost serverhost realname
  33. export realname=${realname:1:$((${#realname}-1))}
  34.  
  35. #echo ":$nickname JOIN $cli_irc_room"
  36. #echo ":localhost MODE $cli_irc_room +t"
  37. #echo ":localhost 332 $nickname $cli_irc_room :$t_welcome"
  38. echo ":$cli_irc_user PRIVMSG $nickname :$t_welcome"
  39.  
  40. ### ElA!gazA!s
  41. $0 in | $0 middle 2>&1 | $0 out
  42. ;;
  43. esac