X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Freset_hosts.pl;h=20f01028b9c93ada5cbd2d92b5d5334d9ff6119a;hb=e98253f3ad7a68c70dd5382f47ac7c3691fac022;hp=4932f051fd74e9005ec578047fea4f9633a026b1;hpb=c5970c4e8713892b0960843e66be24c1e6f24e8f;p=ndwebbie.git diff --git a/scripts/reset_hosts.pl b/scripts/reset_hosts.pl index 4932f05..20f0102 100755 --- a/scripts/reset_hosts.pl +++ b/scripts/reset_hosts.pl @@ -6,18 +6,12 @@ use DBI; use DBD::Pg qw(:pg_types); use LWP::Simple; +use lib qw{/var/www/ndawn/lib/}; +use ND::DB; -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; - } -} +our $dbh = ND::DB::DB(); -$dbh->trace("0","/tmp/scanstest"); +#$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;