summaryrefslogtreecommitdiffstats
path: root/bin/rrancid.in
diff options
context:
space:
mode:
Diffstat (limited to 'bin/rrancid.in')
-rwxr-xr-xbin/rrancid.in15
1 files changed, 12 insertions, 3 deletions
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 <removed>$'") && 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");