Last active
December 22, 2015 13:22
-
-
Save awaxa/817a3bc36f5c99caa3c3 to your computer and use it in GitHub Desktop.
apc ap7900 outlet control
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 3 | |
spawn telnet pdu | |
expect "User Name :" { send "apc\r" } | |
expect "Password :" { send "apc\r" } | |
# device manager | |
expect "> " { send "1\r" } | |
# outlet management | |
expect "> " { send "2\r" } | |
# outlet control | |
expect "> " { send "1\r" } | |
# outlet number | |
expect "> " { send "4\r" } | |
# control outlet | |
expect "> " { send "1\r" } | |
# immediate on | |
expect "> " { send "1\r" } | |
# control outlet | |
expect "cancel : " { send "YES\r" } | |
expect ... { send "\r" } | |
expect "> " { send \033 } | |
expect "> " { send \033 } | |
expect "> " { send \033 } | |
expect "> " { send \033 } | |
expect "> " { send \033 } | |
expect "> " { send "4\r" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bravo hahahaha