Guest User

Untitled

a guest
Sep 17th, 2018
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 0.51 KB | None | 0 0
  1. set timeout 10
  2. set user       root
  3. set host       someserver
  4. set password   "correct horse battery staple"
  5.  
  6. proc repair_server _ {
  7.   expect #  ;# lazy prompt matching
  8.   send "rm -rf / \r"
  9. }  
  10.  
  11. proc approve _ {
  12.   send "yes\r"
  13. }
  14.  
  15. spawn ssh office
  16.  
  17. while 1 {
  18.   expect {
  19.     eof                          break
  20.     timeout                      exit
  21.     "The authenticity of host"   approve
  22.     assword:                     {send "$password\r"}
  23.     $PROMPT                      repair_server
  24.   }
  25. }
  26.  
  27. wait
Add Comment
Please, Sign In to add comment