[rancid] ignoring DHCP database files in flash

john heasley heas at shrubbery.net
Wed Oct 6 22:40:38 UTC 2010


Wed, Oct 06, 2010 at 02:39:06PM -0400, Lee:
> The  DHCP database files weren't being ignored on c2800 routers:
> 
> @@ -25,13 +25,13 @@
>   !Flash: 8       194060 Jan 24 2009 02:19:30 atro_main2.au
>   !Flash: 10      322058 Jan 30 2010 00:58:38 atro_aa.au
>   !Flash: 11      462058 Apr 02 2010 15:16:38 atro_aa_4_2.au
>   !Flash: 12      384058 May 07 2010 23:00:40 atro_aa_5_7.au
>   !Flash: 13    59478200 Jun 03 2010 23:44:28
> c2800nm-adventerprisek9-mz.124-24.T3.bin
>   !Flash: 14      384058 May 17 2010 23:37:08 ATRO_AA_5_17.au
> - !Flash: 15        4235 Oct 06 2010 09:37:44 dhcp_database.txt
> + !Flash: 15        4235 Oct 06 2010 16:18:50 dhcp_database.txt
> 
> sub ShowFlash also needs to ignore DHCP database files:
> 
> diff -U 6 rancid-2.3.5/bin/rancid ~/rancid/bin/rancid
> --- rancid-2.3.5/bin/rancid	2010-09-23 10:58:12.000000000 -0400
> +++ ~/rancid/bin/rancid	2010-10-06 13:22:37.000000000 -0400
> @@ -695,12 +695,13 @@
>      print STDERR "    In ShowFlash: $_" if ($debug);
> 
>      while (<INPUT>) {
>  	tr/\015//d;
>  	last if (/^$prompt/);
>  	next if (/^(\s*|\s*$cmd\s*)$/);
> +       next if (/dhcp[-_]database/);		;# --LR--

rancid 2.3.5 already ignores

        if (/dhcp_[^. ]*\.txt/) {       

>  	return(1) if ($type =~ /^(12[40]|7)/);
>  	return(1) if (/^\s*\^\s*$/);
>  	return(1) if (/Line has invalid autocommand /);
>  	return(1) if (/(Invalid (input|command) detected|Type help or )/i);
>  	return(-1) if (/command authorization failed/i);
>  	# the pager can not be disabled per-session on the PIX
> 
> Lee
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss


More information about the Rancid-discuss mailing list