#!/usr/bin/perl use Net::Telnet; my $dow = `date '+%w' --date '1 days ago'`; my $router = "IP_OF_ROUTER"; my $user = "username"; my $pass = "password"; my $enable = "enable_password"; my $tftp_server = "IP_OF_SERVER"; my $t = new Net::Telnet(Timeout => 10); $t->open( $router ); $t->waitfor( '/Username:/' ); $t->print( "$user" ); sleep 2; $t->waitfor( '/Password:/' ); $t->print( "$pass" ); sleep 2; $t->print( "enable" ); $t->waitfor( '/Password:/' ); $t->print( "$enable" ); sleep 2; $t->print( "copy startup-config tftp" ); sleep 2; $t->print( "$tftp_server" ); sleep 2; $t->print( "router.$dow" ); sleep 3; $t->print( "quit" ); exit( 0 );
In reply to Re: copy run tftp on cisco router using net::snmp
by perlmangle
in thread copy run tftp on cisco router using net::snmp
by c
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |