]> ruin.nu Git - ndwebbie.git/blob - scripts/reset_hosts.pl
Use ND::DB module instead of db.pl
[ndwebbie.git] / scripts / reset_hosts.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4 use warnings;
5 use DBI;
6 use DBD::Pg qw(:pg_types);
7
8 use LWP::Simple;
9 use lib qw{/var/www/ndawn/};
10 use ND::DB;
11
12 our $dbh = ND::DB::DB();
13
14 #$dbh->trace("0","/tmp/scanstest");
15 my $update = $dbh->prepare("UPDATE users SET hostmask = pnick || '.users.netgamers.org' where hostmask ilike '%.%' AND NOT hostmask ilike pnick || '.users.netgamers.org'");
16 $update->execute();
17 $dbh->disconnect;