From: Michael Andreen Date: Sun, 16 Sep 2007 11:26:06 +0000 (+0200) Subject: script that resets the host for users X-Git-Url: https://ruin.nu/git/?p=ndwebbie.git;a=commitdiff_plain;h=c5970c4e8713892b0960843e66be24c1e6f24e8f script that resets the host for users --- diff --git a/scripts/reset_hosts.pl b/scripts/reset_hosts.pl new file mode 100755 index 0000000..4932f05 --- /dev/null +++ b/scripts/reset_hosts.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl -w + +use strict; +use warnings; +use DBI; +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; + } +} + +$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;