From: Brandon C. <bra...@me...> - 2008-12-11 05:01:49
|
I have an expect script as follows: spawn telnet X.X.X.X $podport set timeout 15 sleep 2 send $controlZ send "\r" expect { "no]:" exit ")#" exit "#" {send "\r"} ">" {send "enable\r"} } expect { "Password:" {send "sanfran\r"} "#" {send "\r"} } expect { "Password:" {send "cisco\r"} "#" {send "\r"} } expect { "Password" {send "sanjose\r"} "#" {send "\r"} } expect { "% Bad passwords" exit "#" {send "wr\r"} } expect { "#" {send "write erase\r"} } expect "confirm" send "\r" expect "#" send "reload \r" expect "Proceed with reload?" send "\r" puts "reset of $podport complete\n\n" exit The expect script does exactly what I want it to do, however I cant seem to figure out how to call it from a perl script. So I think I may need to re-write it in Expect.pl and if thats the case how do I express the section: expect { "no]:" exit ")#" exit "#" {send "\r"} ">" {send "enable\r"} } in the Expect.pl? Or, is there an easy way to just tell perl to run the script? Thanks for any help anyone can offer! Brandon Carroll bra...@ma... http://www.brandonjcarroll.com http://www.globalconfig.net |