2 ################################################################################
5 # Description: Connect to a Salira PON
6 # Author: Andrew@DeFaria.com
7 # Created: Fri Jun 6 15:37:15 PDT 2003
10 # (c) Copyright 2003, Andrew@DeFaria.com, all rights reserved
12 ################################################################################
16 # Reporting procedures
18 send_user "ERROR: [join $args]\n"
20 if {[info exist spawn_id]} {
28 send_user "[join $args]\n"
31 proc Login {to_machine {username root} {password root}} {
32 # Establish connection
33 spawn "telnet" $to_machine
35 # Look for Login prompt
40 Error "Host does not appear to be a Salira PON"
43 Error "Machine $to_machine does not exist!"
46 Error "$to_machine is not responding"
56 Error "Password prompt not issued"
62 puts -nonewline "Logged into $to_machine"
63 puts -nonewline $expect_out(buffer)
66 Error "$to_machine appears to be dead"
76 set machine [lindex $argv 0]
78 if {![info exist machine] || $machine == ""} {
79 Error "You must specify a machine to log into"
82 set spawn_id [Login $machine]