From b88919bea4b222a616adbdd2b82fc262a14afc8d Mon Sep 17 00:00:00 2001 From: Tar Committer Date: Mon, 5 Feb 2001 17:47:18 +0000 Subject: Imported from rancid-2.1.tar.gz. --- bin/rrancid.in | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'bin/rrancid.in') diff --git a/bin/rrancid.in b/bin/rrancid.in index 9d9b84f..9d40591 100755 --- a/bin/rrancid.in +++ b/bin/rrancid.in @@ -212,11 +212,19 @@ sub WriteTerm { # order access-lists /^access-list\s+(\d\d?)\s+(\S+)\s+(\S+)/ && ProcessHistory("ACL $1 $2","ipsort","$3","$_") && next; + # prune snmp community statements + if (/^snmp (group|community) (\S+)/) { + if (defined($ENV{'NOCOMMSTR'})) { + ProcessHistory("SNMPSERVERCOMM","keysort","$_","!snmp $1 $'") && next; + } else { + ProcessHistory("SNMPSERVERCOMM","keysort","$_","$_") && next; + } + } ProcessHistory("","","","$_"); # end of config - if (/^end$/) { - $found_end = 1; - last; + if (/^end$/) { + $found_end = 1; + last; } } return; @@ -286,6 +294,7 @@ if ($file) { } } +ProcessHistory("","","","!RANCID-CONTENT-TYPE: redback\n!\n"); ProcessHistory("COMMENTS","keysort","B0","!\n"); ProcessHistory("COMMENTS","keysort","C0","!\n"); ProcessHistory("COMMENTS","keysort","E0","!\n"); -- cgit