Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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