Guest User

Untitled

a guest
May 17th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 0.42 KB | None | 0 0
  1. bind pub - !website webserver_up
  2. proc webserver_up { nick host handle chan {text ""} } {
  3.     set webhost [lindex $text 0]
  4.     if { [catch {socket $webhost 80} msg] } {
  5.       # some error occured and msg holds the error message
  6.       puthelp "PRIVMSG $chan :$nick, website is down!"
  7.     } else {
  8.       # all is ok and msg holds the result of the command
  9.       puthelp "PRIVMSG $chan :$nick, website is up."
  10.     }
  11.  
  12. }
Add Comment
Please, Sign In to add comment