Clogin Options
john heasley
heas at shrubbery.net
Fri Sep 23 20:07:59 UTC 2005
you could stir in par(1) and do that in parallel.
Fri, Sep 23, 2005 at 11:22:15AM -0700, Stafford A. Rau:
> I often use this sort of thing:
>
> #!/usr/bin/perl -w
>
> my @routers;
> my $clogin = "/usr/local/rancid2/bin/clogin";
> my $clogin_cmd = "-c conf t\nconfig line blah\nconfig line 2 blah\nexit\nwrite\n\n";
>
> open ROUTERDB, "/usr/local/rancid2/group_name/router.db" or
> die "Can't open router.db: $!";
> while (<ROUTERDB>) {
> if ( /\:down$/ ) { next; }
> s/\:.*$//;
> push @routers, ($_);
> }
>
> for my $router (@routers) {
> chomp $router;
> print "===$router===\n";
> system ( "$clogin", "$clogin_cmd", "$router" );
> }
>
> For more complicated configs, I use clogin to just tell the router to do
> a copy tftp: run; write; and I put the config in a tftp server
> accessible file.
>
> --Stafford
More information about the Rancid-discuss
mailing list