Last active
January 1, 2016 08:29
-
-
Save cmur2/8118431 to your computer and use it in GitHub Desktop.
Persisting the Netgear Traffic Meter using expect (http://blog.altimos.de/2013/12/persisting-the-netgear-traffic-meter-using-telnet-and-expect/)
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 20 | |
set name [lindex $argv 0] | |
set user [lindex $argv 1] | |
set password [lindex $argv 2] | |
spawn telnet $name | |
expect "login: " | |
send "$user\n" | |
expect "Password: " | |
send "$password\n" | |
expect "$ " | |
send "monitor/trafficMtr/summary wanId 1\n" | |
expect "Percentage of this Month's Limit" | |
expect "$ " | |
send "exit\n" | |
expect eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment