Skip to content

Instantly share code, notes, and snippets.

@owenb321
Created November 8, 2014 04:17
Show Gist options
  • Save owenb321/2774e9f20a2c53699121 to your computer and use it in GitHub Desktop.
Save owenb321/2774e9f20a2c53699121 to your computer and use it in GitHub Desktop.
Expect script to switch profiles in Prismatik
#!/usr/bin/expect
set timeout 5
set host [lindex $argv 0]
set port [lindex $argv 1]
set profile [lindex $argv 2]
set apikey [lindex $argv 3]
spawn telnet $host $port
expect "Lightpack API v1.4 (type \"help\" for more info)\r"
send "apikey:$apikey\r"
expect "ok\r"
send "lock\r"
expect "lock:success\r"
send "setprofile:$profile\r"
expect "ok\r"
send "unlock\r"
expect "unlock:success\r"
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment