X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Freset_hosts.pl;h=81c4c0e5f0e99ef07947d95da8e206f9e197eeaa;hb=d786ab3e431fdb29854f4d80fe430c5438d649b6;hp=4932f051fd74e9005ec578047fea4f9633a026b1;hpb=c5970c4e8713892b0960843e66be24c1e6f24e8f;p=ndwebbie.git diff --git a/scripts/reset_hosts.pl b/scripts/reset_hosts.pl index 4932f05..81c4c0e 100755 --- a/scripts/reset_hosts.pl +++ b/scripts/reset_hosts.pl @@ -2,22 +2,18 @@ use strict; use warnings; +use local::lib; use DBI; use DBD::Pg qw(:pg_types); -use LWP::Simple; +use FindBin; +use lib "$FindBin::Bin/../lib"; -our $dbh; -for my $file ("/home/whale/db.pl") -{ - unless (my $return = do $file){ - warn "couldn't parse $file: $@" if $@; - warn "couldn't do $file: $!" unless defined $return; - warn "couldn't run $file" unless $return; - } -} +use ND::DB; -$dbh->trace("0","/tmp/scanstest"); +our $dbh = ND::DB::DB(); + +#$dbh->trace("0","/tmp/scanstest"); my $update = $dbh->prepare("UPDATE users SET hostmask = pnick || '.users.netgamers.org' where hostmask ilike '%.%' AND NOT hostmask ilike pnick || '.users.netgamers.org'"); $update->execute(); $dbh->disconnect;