aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJoachim Tingvold <joachim@tingvold.com>2015-04-16 21:12:29 +0200
committerroot <root@wat.gathering.org>2015-04-16 21:12:29 +0200
commitdf68d675e74633c1980838e8174e939dd4078f85 (patch)
treec546387a3bc83889401b0f6872fac36a341bd24b /tools
parent7147d88f6e3c15a2cce29fc39484280964ac81bc (diff)
Added config used at TG15.
Diffstat (limited to 'tools')
-rw-r--r--tools/sql-strip.pl35
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/sql-strip.pl b/tools/sql-strip.pl
new file mode 100644
index 0000000..0e2fec6
--- /dev/null
+++ b/tools/sql-strip.pl
@@ -0,0 +1,35 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+my $ignore = "((([0-9a-f]{2}[:]){5}[0-9a-f]{2})|";
+$ignore .= "([0-9]{4}\-[0-9]{2}\-[0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2})";
+$ignore .= ").*";
+
+my $community = "<removed>";
+my $snmpv3 = 'SHA/<removed>/AES/<removed>';
+
+my $skip = 0;
+
+open (SQL, $ARGV[0]) or die "Unable to open SQL-file";
+while (<SQL>) {
+ unless (/^$ignore$/){
+
+ if (/COPY (linknet_ping|ping|mbd_log|squeue|temppoll|ap_poll|polls)/){
+ $skip = 1;
+ print;
+ }
+
+ if (/\\\./){
+ $skip = 0;
+ }
+
+ unless ($skip){
+ s/$community/<removed>/g; # community
+ s/PASSWORD '.+'/PASSWORD '<removed>'/g; # password for SQL-users
+ s/public$/<removed>/; # public-community -- assuming last column
+ #s/$snmpv3/SHA\/<removed>\/AES\/<removed>/g; # snmpv3
+ print;
+ }
+ }
+}