]> ruin.nu Git - ndwebbie.git/blobdiff - scripts/reset_hosts.pl
Add the dependencies file
[ndwebbie.git] / scripts / reset_hosts.pl
index 4932f051fd74e9005ec578047fea4f9633a026b1..040445b90b786fa9de102df85c3cba29a9f59dc1 100755 (executable)
@@ -7,17 +7,14 @@ use DBD::Pg qw(:pg_types);
 
 use LWP::Simple;
 
-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 FindBin;
+use lib "$FindBin::Bin/../lib";
 
-$dbh->trace("0","/tmp/scanstest");
+use ND::DB;
+
+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;