jcpunk has asked for the wisdom of the Perl Monks concerning the following question:
$PASSWD = "/bin/passwd"; $telnet->cmd($PASSWD) or report_error("ERROR", "No password prompt fou +nd, contact Information Technologies: "); $telnet->waitfor('/password: ?$/i') or report_error("ERROR", "No passw +ord prompt found, contact Information Technologies: "); $telnet->print($password); $telnet->waitfor('/new password: ?$/i') or report_error("ERROR", "No p +assword prompt found, contact Information Technologies: "); $telnet->print($new_password); $telnet->waitfor('/new password: ?$/i') or report_error("ERROR", "No p +assword prompt found, contact Information Technologies: "); $telnet->print($new_password); $telnet->waitfor('/changed/'); ..... sub report_error { #give out std error message and write error to a log file }
by the way thanks for all the help that was, is, and will be
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::Telnet and changing passwords
by phydeauxarff (Priest) on Jun 27, 2003 at 18:34 UTC | |
by jcpunk (Friar) on Jun 27, 2003 at 18:42 UTC | |
by phydeauxarff (Priest) on Jun 28, 2003 at 00:11 UTC | |
by jcpunk (Friar) on Jun 30, 2003 at 14:05 UTC |