Re: Saving configs from Cat1900

From: Jesper Skriver (jesper@skriver.dk)
Date: Thu Nov 25 1999 - 14:57:56 EST


On Wed, Nov 24, 1999 at 03:04:06PM +0100, Jesper Skriver wrote:
> Hi,
>
> Does anyone have a script, or guidelines on howto, that can save the
> config of a cat 1900 ?
>
> They doesn't seem to support any of the methods used for Cat5k or IOS
> routers ...

Reply'ing to myself, just if anyone else could benefit from this script,
this echo's everything out, so it needs to processed afterwards.

/Jesper

#!/usr/local/bin/expect -f

set host [lindex $argv 0]
set user [lindex $argv 1]
set pass [lindex $argv 2]
set enable [lindex $argv 3]

stty -echo

spawn telnet $host

expect "Enter Selection: "
send "k\r"
while {1} {
  expect "sername:" {
    send "$user\r"
    expect "assword:"
    send "$pass\r"
  } ">" {
     break
  }
}
  
send "enable\r"
expect assword:
send "$enable\r"
expect "#"
stty echo
send "show run\r"
while {1} {
        expect "More" {
                send " "
        } "#" {
               send "exit\r"
               exit
        }
}

/Jesper

-- 
Jesper Skriver (JS4261-RIPE), Network manager      
Tele Danmark DataNet, IP section (AS3292)

One Unix to rule them all, One Resolver to find them, One IP to bring them all and in the zone to bind them.



This archive was generated by hypermail 2b29 : Sun Aug 04 2002 - 04:12:07 EDT