Skip to content

Instantly share code, notes, and snippets.

@itskenny0
Created September 12, 2017 22:30
Show Gist options
  • Save itskenny0/8df55062b5d6cc6aa99f8aed4feb1b2d to your computer and use it in GitHub Desktop.
Save itskenny0/8df55062b5d6cc6aa99f8aed4feb1b2d to your computer and use it in GitHub Desktop.
CommuniGate: Programmatically change account passwords from the shell
#!/usr/bin/expect
set username [lindex $argv 0]
set newpassword [lindex $argv 1]
spawn telnet 127.0.0.1 106
expect "*ready*"
send "USER postmaster\r"
expect "300 please send the PASS"
send "PASS postmaster_password_here\r"
expect "200 login OK, proceed"
send "SETACCOUNTPASSWORD $username PASSWORD $newpassword\r"
expect "200 OK"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment