You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
710 B
50 lines
710 B
#!/usr/bin/expect -f
|
|
|
|
set username YOURCALLSIGN
|
|
set passwd YOURPASSWORD
|
|
set portnum BPQPORTNUMBER
|
|
|
|
set timeout 4
|
|
|
|
#spawn ./nodeconnect.sh
|
|
spawn telnet 127.0.0.1 8010
|
|
|
|
|
|
expect {
|
|
timeout {puts "timed out"; exit}
|
|
"user:"
|
|
}
|
|
send -- "$username\r"
|
|
|
|
|
|
expect {
|
|
timeout {puts "timed out"; exit}
|
|
"password:"
|
|
}
|
|
send -- "$passwd\r"
|
|
|
|
expect {
|
|
timeout {puts "timed out"; exit}
|
|
"*Press ? For list of commands*"
|
|
}
|
|
send -- "v\r"
|
|
|
|
expect {
|
|
timeout {puts "timed out"; exit}
|
|
"*\} Version*"
|
|
}
|
|
send -- "mhv $portnum\rv\r"
|
|
|
|
set ::file [ open mhlist.txt w ]
|
|
|
|
expect {
|
|
timeout {puts "timed out"; exit}
|
|
"*\} Version*"
|
|
|
|
}
|
|
puts -nonewline $::file $expect_out(buffer)
|
|
|
|
close $::file
|
|
|
|
send -- "b\r"
|