Created
November 8, 2014 04:17
-
-
Save owenb321/2774e9f20a2c53699121 to your computer and use it in GitHub Desktop.
Expect script to switch profiles in Prismatik
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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