[rancid] Re: Script with cisco-reload.exp

john heasley heas at shrubbery.net
Fri Apr 20 16:54:55 UTC 2007


Fri, Apr 20, 2007 at 06:50:53PM +0200, Christophe Terpreau:
> In fact there is no failure but only first ip in routers.db is used.

indeed;

expect {
        timeout         { send_error "Error: timeout waiting for EOF after quit\
n"}
        eof     { exit 0 }
		  ^^^^^^

The script calls exit.

> 2007/4/20, john heasley <heas at shrubbery.net>:
> >Fri, Apr 20, 2007 at 02:11:49PM +0200, Christophe Terpreau:
> >> hello,
> >>
> >> i'm using a script found in this mailing list to execute some commands
> >> on devices listed in routers.db:
> >>
> >> clogin -x yourscript ` find . -name router.db |   xargs awk -F: '$3 ==
> >> "up" && $2 == "cisco" && $1 !~ /^#/ {print $1}'`
> >>
> >> I would like to schedule a reboot with "clogin  -Ereload_arg='at
> >> 07:15' -s cisco-reload.exp" on the same devices list in router.db but
> >> "xargs awk -F: '$3 == "up" && $2 == "cisco" && $1 !~ /^#/ {print $1}'`
> >> " seems not working.
> >>
> >> Thx if you can help me on this.
> >
> >I expect that to work, but you haven't described the failure.  try a loop;
> >
> >for rtr in `find ...` do
> >  clogin -s ... $rtr
> >done
> >



More information about the Rancid-discuss mailing list