diff options
| author | Darkelarious <darkelarious@333networks.com> | 2016-11-19 20:56:04 +0100 |
|---|---|---|
| committer | Darkelarious <darkelarious@333networks.com> | 2016-11-19 20:56:04 +0100 |
| commit | c3f8d65a4fb1f5674557ee67cf7f74369df86ad1 (patch) | |
| tree | 92aab2a394bda28da0ed7c7c75e633fdf386fc71 /util/tools/db_manual_batch_insert.pl | |
| parent | 1de3da4b8027508a91144639455c934fd6ccb9b7 (diff) | |
| download | MasterServer-Perl-c3f8d65a4fb1f5674557ee67cf7f74369df86ad1.tar.gz MasterServer-Perl-c3f8d65a4fb1f5674557ee67cf7f74369df86ad1.zip | |
Massive improvements on efficiency, robustness, security, reliability and more
Diffstat (limited to 'util/tools/db_manual_batch_insert.pl')
| -rwxr-xr-x | util/tools/db_manual_batch_insert.pl | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/util/tools/db_manual_batch_insert.pl b/util/tools/db_manual_batch_insert.pl new file mode 100755 index 0000000..5b65a13 --- /dev/null +++ b/util/tools/db_manual_batch_insert.pl @@ -0,0 +1,44 @@ +#!/usr/bin/perl + +################################################################################ +## Manual use to insert one or a batch of IP-addresses/ports into the pending +## list, rather than manually adding them with psql. +## +## Use with care! +################################################################################ + +use strict; +use warnings; +use Encode; +use DBI; +$|++; + +our %S; +require "../../data/supportedgames.pl"; +require "r_secure.pl"; +require "r_database.pl"; +require "r_functions.pl"; +require "r_lists.pl"; + +# open db +our $dbh; + +# import list of ip:ports +my @ips = qw( + + +); + +$dbh->begin_work; +foreach my $l (@ips) { + + # break ip:port into $a (ip) and $q (query port) + if ($l =~ /:/) { + my ($a,$p) = valid_address($l); + db_add_server(ip => $a, port => $p); + } +} +$dbh->commit; + +# close db +$dbh->disconnect(); |
