Skip to content

Instantly share code, notes, and snippets.

@TheCase
Last active March 12, 2016 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheCase/c441a3d138dfab70ec6c to your computer and use it in GitHub Desktop.
Save TheCase/c441a3d138dfab70ec6c to your computer and use it in GitHub Desktop.
#!/usr/bin/expect
set cmd [lindex $argv 0]
eval spawn ssh admin@ap
set prompt ":|#|\\\$"
interact -o -nobuffer -re $prompt return
send "the-actual-passsword\r"
interact -o -nobuffer -re $prompt return
send "system led $cmd\r"
interact -o -nobuffer -re $prompt return
send "exit\r"
interact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment