This is a script to log in to a server via Telnet and run a single script remotely.

require 'net/telnet.rb'

myserver.com = Net::Telnet::new("Host" => "myserver.com",  "Timeout" => 30,  "Prompt" => /[$%#] \z/n)

myserver.com.login("username", "password") { |c| print c }myserver.com.closemyserver.com.cmd("./check_missing.sh") { |c| print c }

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Live
  • StumbleUpon
  • Tumblr
  • TwitThis
  • FriendFeed
  • Netvibes
  • Ping.fm
  • Posterous
  • Technorati
  • Tipd
  • Twitter
  • Yahoo! Buzz