Difference between revisions of "Expect remote commands"

From WA2IAC Wiki
Jump to: navigation, search
m (Preamble)
m (The Code)
 
Line 29: Line 29:
 
#
 
#
  
spawn ssh -l root 192.168.44.1
+
spawn ssh -l username hostname
expect "id_rsa"
+
send  "\r"
+
 
expect "ord\\: "
 
expect "ord\\: "
send "ddwrt\r"
+
send "password\r"
set handle [ open ddwrt_routes r ]
+
set handle [ open commands.txt r ]
 
while { ! [eof $handle] } {
 
while { ! [eof $handle] } {
 
         gets $handle buf
 
         gets $handle buf

Latest revision as of 18:26, 10 March 2015